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

后端 未结 25 1079
北荒
北荒 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:11

    Click on a different view controller in the storyboard, then click on it's custom class pulldown to confirm the new class is listed, but don't select it. Click back on the new view controller you made and you should see it now listed in its custom class pulldown menu. odd, eh? just forces a refresh I think.

    0 讨论(0)
  • 2020-12-08 02:11

    I had to restart XCode 7.3 (7D175)

    0 讨论(0)
  • 2020-12-08 02:12

    In my case, I selected the wrong UI.. so I deleted the class file and created a new one and selected the correct parent class

    0 讨论(0)
  • 2020-12-08 02:14

    If you still have your problem or for those who could have the same problem:

    Make sure to select on your storyboard your "ViewController" instead of your "View" (which is automatically selected when you click on the view in the storyboard). The difference between those two is that when the view controller is selected, a blue rectangle pop up around your app. To be sure to select the view controller, open the document outline and select it directly in your storyboard hierarchy.

    enter image description here enter image description here enter image description here

    0 讨论(0)
  • 2020-12-08 02:18

    In my case, I drag a new TableViewController object to the storyboard, but I add a new file which's subclass is "UIViewController".... Then, I add a file which's subclass is "UITableViewController", problem solved!!

    0 讨论(0)
  • 2020-12-08 02:20

    Storyboard is looking for the custom class but physically its no there and its not displaying the custom class name in the list and also not displaying the outlets . Following solution perfectly worked for me.

    1. Just copy your code some where else.(Lets say on desktop)
    2. Open your existing code.
    3. Delete the custom class file.(Move to trash)
    4. Now add files from copied project folder (From desktop)
    5. Don't forget to check "Copy if needed" check box
    6. Open the story board and bingo you will get your custom class files in dropdown
    0 讨论(0)
提交回复
热议问题