标签:swift xib storyboard
初学swift,代码加载xib storyboard
-.加载xib
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?){ super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) } convenience init() { var nibNameOrNil = String?("ViewController") self.init(nibName: nibNameOrNil, bundle: nil) } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") }
var jumpViewController: ViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("Storyboard ID") as! ViewController self.navigationController?.pushViewController(jumpViewController, animated: true)
Storyboard ID 是storyboard绑定的ID
viewController 是绑定的Class
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:swift xib storyboard
原文地址:http://blog.csdn.net/liuxiaoming1109/article/details/47340449