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

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

    For macOS projects, creating a new class generated a class inheriting from NSObject instead on NSViewController.

    Change from

    import Cocoa
    
    class AppsViewController: NSObject {
    
    }
    

    to

    import Cocoa
    
    class AppsViewController: NSViewController {
    
    }
    

提交回复
热议问题