Swift用代码进行界面跳转

2015-01-25 16:20

1.storyborad上面画图,然后绑定一个cocoa的界面文件,storyboard id 和 restoration id 填类名

2.然后

var sb = UIStoryboard(name: "Main", bundle:nil)

var vc = sb.instantiateViewControllerWithIdentifier("dengluViewController") as dengluViewController

self.navigationController?.pushViewController(vc, animated: true)


就可以了。