I have a UIViewController I created in my apps storyboard, as well as a custom UIViewController subclass which I added to the project (and is correctly in the compile phase
I was fairly frustrated with this issue as none of the answers above had solved my problem.
In my case: I was in the middle of working on swift view controller file and was making active changes (such as creating a custom collection cell class). I had not finished the code block and left it open like so :
class tableViewCell: UITableViewCell {
}
class collectionCell:
class viewController: UIViewController {
override func viewDidLoad(){
super.viewDidload()
}
}
Note the incomplete code block 'collectionCell2' This was enough for xcode to not recognize my viewController file as such. Once I completed this block the file reappeared in my xcode as an option.
Very silly and simple.