我的 Xcode 项目带有默认值:
class ViewController: UIViewController
然后我用 ID next
创建了一个新的 View Controller 。
如何创建一个类似于项目已经创建的类,但用于我的 View Controller next
?
我认为它看起来像:
class next: UIviewcontroller
最佳答案
如果我明白你想做什么,那么你需要创建一个类 NextViewController
并覆盖方法 viewDidLoad
和 didReceiveMemoryWarning
,如下所示:
class NextViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
然后在 Storyboard的 Identity inspector
选项卡中选择为您的 ViewController
创建的类,如下所示:
关于ios - 为新的 View Controller 创建一个类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33462039/