针对手写页面及storyboard制作页面,使用代码进行页面跳转的两种方法。
▪ 手写页面:
var vc = ViewController()
self.presentViewController(vc, animated: true, completion: nil)
return
▪ storyboard制作页面
var sb = UIStoryboard(name: "Main", bundle:nil)
var vc = sb.instantiateViewControllerWithIdentifier("VC") as ViewController
//VC为该界面storyboardID,Main.storyboard中选中该界面View,Identifier inspector中修改
self.presentViewController(vc, animated: true, completion: nil)
return
网友评论