Swift的两个页面之间的跳转
2016-08-29 本文已影响153人
等不来的期待
1.首先要先建一个Swift的工程

2.记得language要选择Swift的

第二步:新建两个.Swift文件,具体怎么建的,方式跟OC是一样的,就不多说了
第三部:设置AppDelegate
1)、设置导航栏,代码如下,简单的三行代码就搞定了:
let fristVC = FristVC()
//设置导航栏
let rootNavigationController = UINavigationController(rootViewController:fristVC)
self.window!.rootViewController = rootNavigationController
self.window?.makeKeyWindow()
2)、跳转的方法如下:

到这差不多结束了,效果图如下:
第一张:

第二张:

具体代码请参考:https://github.com/wangningsai/Ski