StoryBoard传值

2016-02-17  本文已影响69人  嗯o哼

一、利用Segue 方法

在performSegueWithIdetifier方法
   override func prepareForSegue(segue: UIStoryboardSegue, sender: 
AnyObject?) {
     var theSegue = segue.destinationViewController as           
     SecondViewController
     theSegue.text = "Pass"
}

二、 利用self.storyboard

var thirdVC = 
self.storyboard?.instantiateViewControllerWithIdentifier("ThirdViewController") as ThirdViewController
 thirdVC.text = "Pass"
self.navigationController?.pushViewController(thirdVC, animated: true)
上一篇 下一篇

猜你喜欢

热点阅读