Why aren't my custom classes appearing in the dropdown in Interface Builder?

后端 未结 2 1303
星月不相逢
星月不相逢 2021-01-26 11:19

I am using Interface Builder and Storyboards to build my app. I am trying to connect my source code to my UIViewController in Storyboard, but none of my classes sho

相关标签:
2条回答
  • 2021-01-26 12:13

    It appears that your classes aren't added to the project target. Try this:

    1) Make sure your classes are added to the right target membership on the Inspectors Panel on the right:

    2) Make sure the class inherits the View Controller type:

    class CustomViewController: UIViewController
    

    3) Reload xCode and check if the class is enabled:

    0 讨论(0)
  • 2021-01-26 12:21

    It happened to me and I've noticed the Class dropdown was showing classes from another project that I have opened in the background. After closing all the other projects, the drop down finally showing the correct list of classes from the project that I'm working on. Seems like an Xcode storyboard editor bug.

    0 讨论(0)
提交回复
热议问题