Template Dialogue Box not showing up when trying to create a new file in a Xcode Workspace - ios

When I right click to add a new file (or do File -> New -> File), I don't get a dialogue box asking me which Template I want to use. It just creates a blank file like this:
I tried renaming it to a .swift file and adding in all the necessary code to start off, but two things happen:
First, the autocomplete function is one step behind. So when I've already typed import UIKit and moved on, it starts trying to autocomplete UIKit. And when I've already typed class className: UICollectionViewController {
} and moved on, it starts trying to autcomplete UICollectionViewController
After I manually type in the bare minimum needed to make a swift file into a UICollectionViewController with a colored background, I can't reference it in my other files.
I can only assume this is because of the lack of a template dialogue box, but maybe I'm wrong. Is there any way to toggle this template dialogue box on or off?
This problem is only happening with this particular project since I updated to Xcode 10.1
I can't seem to find anyone else online who's already had this issue. The only similar questions I found online were referring to creating reference folders rather than groups. I didn't find anything regarding the file template dialogue box not showing up.

I fixed this and I'll post the answer in case anyone else comes across this problem.
It was tedious, but I:
Created a new project
Initialized my podfile, added what was in the previous one, and installed it
Opened up the new workspace
Added each file one by one
Maybe there's an easier/quicker way to do it, but after looking through all the settings and not finding anything, I ended up doing this and it worked.

Check that in the left hand pane displaying your project structure you are adding the new file to a folder which comes under your application (identified by a blue Xcode application icon) instead of a general folder as your top level (identified by a blue folder icon). I can't add images yet so please see link.

Related

Breakpoint not working on specific classes on Xcode

[![enter image description here][1]][1]I Tried all possible setting manipulation of xcode, even i cleaned xcode app from my mac and then reinstalled too, but still no luck, But Breakpoints works on almost all calsses except some , later on breakpoint navigator i noticed classes on which breakpoint not working are marked RED. I am wondering what is the actual cause ?
Update : After i removed ad added that specific file the red mark are gone, but result is not improved !
I see red text color labels so probably you have deleted files.
If your files exist and you dont see any breakpoint stopped in your class simply it's because your project probably crash before arriving in this class or by-pass it. Check who call DriveCreateAccountVC in your code and put some breakpoints before this class is called in the code, Im pretty sure you find your mistake.
It's a good attitude use the debug console by printing your flow in your code like this line for example: (you can put in viewDidAppear or viewDidLoad)
print("∙ \(NSStringFromClass(self.dynamicType))")
it's a little help but print the class name where are your flow in this moment. You can go also on the debug console and writing for example:
po myStringArray.description
po myStringArray.count
Another useful thing is to add these two options in your editing settings (it's not in defaults settings) : (line numbers and code folding ribbon)
A class becomes Red, when it has lost its path(Xcode can't locate the class)
This may happen because you maybe you copied flies from one project to another or something like that:
There are 2 solutions:
Before anything, locate the files in your Finder
Solution 1) Find the files and put them in your project directory.
Solution 2) Click the file in red in your Project Navigator
Then click on the button (showed in the image link above, to the right of tweetCell.swift)
Once you click it, you will get a chance to locate the file, do it.

Does my Xcode project broken

My Xcode iOS project is kind of broken I think.When I create a new file in my group,the file's location is somewhat different from other Xcode iOS project.For example,when I create a Cocoa Touch Class called EEViewController,you can find its location is too long in the Identity and Type of the File inspector.
But when I right click the file and click Show In Finder,drag the file to the desktop and drag it back the its original group.The location's patch seems to be okay.(It can finally be referenced in Storyboard custom class)
I think it is has something to do with my Xcode configuration,but I just can't figured it out.Hope someone can help me.
To my understanding, ../../../benson/OneHome/OneHome/EEViewController.swift is relatively the same as just EEViewController.swift in your case as it's based on the location related to the group.
../ means go up 1 level in the path, up 3 level then dive in 3 makes it the same path.
I think the issue here is the case of your home dir. In the second screenshot it shows "Benson" and the first shows "benson". OS X is a case sensitive file system, that might be a problem for Xcode.

Xcode stalls on "loading" when trying to create new project

Xcode 6 never gets past "Loading" when I try to create a new project. I actually was able to create a new project yesterday, but I decided to just ditch it completely (deleted). Clearly there must be a bad file somewhere, possibly related to the project I deleted, since I also see the same stalling behavior now with Xcode 5.1, which has worked fine for creating new projects in the past. Xcode 6 has worked fine when starting with an already existing project and still appears to do so. I did not see this exact problem in your data base, though one person saw the project creation freeze before reaching the stage I get to. Their solution was to delete Xcode and every possible file related to it, which I'm a little squeamish about, since I don't want to affect existing projects, and don't have an understanding of what the various files are for.
Deleting the DerivedData of Xcode should fix the issue. You can do this by heading to ~/Library/Developer/XCode/DerivedData (with a Finder window open press cmd+G) and deleting all the subfolders of it.
This is embarrassing, but if it could happen to me, maybe it could happen to someone else. The problem was that the window that came up after the second step in defining the type of project to be created, the one in which you choose where to save the project's files, extended off the bottom of the screen, so that only the very tops of the buttons were visible. Eventually, I realized the one to the far right might be the one to click to continue. Which it was. Feel free to delete this question.

Xcode 6 GM, IB Challenge and Swift

I'm hoping someone can help me or even just let me know that I'm not going out of my mind. I have been searching for an answer to my issue for the past 4 hours and have tried many solutions, none seem to help.
My challenge is that I don't seem to be able to make use of a custom class for a view controller within the GM release of Xcode 6. Here is what I have done.
Begin a new project using File -> New -> Project, selected for an iOS
single view application to start. Once the initial application has
been created, it runs fine within the simulator.
Now I go into my ViewController.swift and change class
ViewController: UIViewController { to class ViewControllerxxx:
UIViewController {
Next, I go into my Main.Storyboard, select the View Controller and
drop down the custom list class where I do not see my custom class.
Now here is where is gets strange.
If I open a project that was created on an earlier beta build of Xcode, the above process works just fine and I see my custom class, just not with newly created projects.
Does anyone else see this behavior, or is it just me?
Hoping someone can shed some light for me...
BTW - manually defining the custom class name doesn't work either - I get a runtime error saying the class is unknown.
Many thanks in advance,
Jon
It would appear that I have fixed it although I have no idea how or why. Basically all of my projects are stored in a folder \Users\jon\code. I renamed the code folder to code.old and then back to code again and for whatever reason, it works now without an issue. I have zero idea as to what caused this issue as nothing in the folder has changed, but the issue is certainly resolved, or at least it appears to be.
So to anyone else experiencing this issue. First try creating a project in a location different to where you are when experiencing the problem. For example, if you are creating your project in Documents, try creating it in the root of your home folder.
If this works, drop to a terminal and using the mv command, rename your projects folder to something else and then back again. After this, I was able to create as many new projects as I wanted, an none had the issue.
Hope this helps someone...

Disappearing files, refactoring mess

I'm pretty green, but I'm trying to modify a simple program to fit my own needs. You may remember the "BirdWatching" app from "Your Second iOS App: Storyboards" in the iOS Developer's Library.
Anyway, I've refactored most of the names, etc., successfully (it still worked), but then I tried to get rid of a file that kept appearing, even though its name had been expunged (or so I thought) through refactoring. Shows up in the Assistant Editor, right next to the file to which it was refactored.
Now I've got a mess. I tried to move the entire project into it's own folder, but now the compliler won't recognize the info-plist file (says it doesn't exist, and two other files are showing up in red, depending on their position in the navigator. However, it's the WMDG-info.plist that the complier complains about. Specifically, it appears to be following the old path to the file, even after it's been moved and re-added.
I've tried quitting and restarting xCode, re-adding the files, etc. I've searched under every keyword I can think of, but can't find a solution.
Please help!
Thanks!
--Tim

Resources