Storyboard uiviewcontroller, 'custom class' not showing in drop down

后端 未结 25 1222
北荒
北荒 2020-12-08 01:34

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

25条回答
  •  遥遥无期
    2020-12-08 02:08

    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.

提交回复
热议问题