在网站制作中,页面跳转□□使用超链□□接,A标签,非常方便▼简单,但是在IOS APP开发中就□□没那么容□□易了,需要写比□□较多的代□□码,BG大游集团□□□以下为你□□一一分享APP页面跳转◤方法全解。

一、 使用StoryBoard点击按钮□□□直接跳转□□□□到新页面
按住Ctrl键,拖动连接线到目标页面,弹出窗口选择modal 则为新页面
如果要选择push,则原页面要实现Navigation导航
二、 利用Segue代码跳转
在起始页□□面按住Ctrl键拖动连□□□接线到目□□□□标页面,弹出窗口◎选择动作□□□□类型,然后选中□□页面连线,属性框中□□□命名Indetifier,然后中页□□面代码处□□需要跳转□□□地方使用
self.performSegueWithIdentifier ("CatSegue", sender: nil)
三、 代码PUSH
let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("CategoryViewController") as! CategoryViewController
self.navigationController.pushViewController(vc, animated:true)
四、 代码Modal
let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let vc = mainStoryboard.instantiateViewControllerWithIdentifier("CategoryViewController") as! CategoryViewController
self.presentViewController(vc, animated: true, completion: nil)