swift jump page ways

前端之家收集整理的这篇文章主要介绍了swift jump page ways前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1
var sb = UIStoryboard(name: “Main”,bundle:nil)
var vc = sb.instantiateViewControllerWithIdentifier(“ChooseViewController”) as ChooseViewController
self.presentViewController(vc,animated:true,completion:nil)

2
var vc = AnswerViewController()
self.presentViewController(vc,animated: true,completion: nil)

3
self.dismissViewControllerAnimated(true,completion:nil)

4 add Segue in storyboard
override func prepareForSegue(segue: UIStoryboardSegue!,sender: AnyObject!) {
var channelC:ChannelController=segue.destinationViewController as ChannelController
channelC.delegate=self
channelC.channelData=self.channelData
}

5
var webView=WebViewController()
webView.detailID=data.newsID
//取导航控制器,添加subView
self.navigationController.pushViewController(webView,animated:true)

6

func popViewControllerAnimated() -> UIViewController! 弹出最上面的视图,并返回下一个视图控制器

7.通过func popToViewController(animated:) -> AnyObject[]!返回到navigationController视图堆栈中指定的某一个视图

http://swiftist.org/topics/169

猜你在找的Swift相关文章