func application(application: UIApplication,dIDFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // OverrIDe point for customization after application launch. self.window?.backgroundcolor = UIcolor.whitecolor() let firstVC = FirstVIEwController(nibname:nil,bundle: nil) let navigation = UINavigationController(rootVIEwController: firstVC) self.window?.rootVIEwController = navigation; return true }二、导航条上添加按钮
let item = UIbarbuttonItem(Title: "下一个",style: UIbarbuttonItemStyle.Plain,target: self,action: "buttonClick:") self.navigationItem.rightbarbuttonItem = item三、跳转到下一个界面
func buttonClick(button:UIbutton) { let secondVC = SecondVIEwController(nibname:nil,bundle: nil) self.navigationController?.pushVIEwController(secondVC,animated:true) }四、返回到上一个界面
func back() { self.navigationController?.popVIEwControllerAnimated(true) }总结
以上是内存溢出为你收集整理的Swift NavigationController的使用全部内容,希望文章能够帮你解决Swift NavigationController的使用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)