美文网首页
StoryBoard传值

StoryBoard传值

作者: 嗯o哼 | 来源:发表于2016-02-17 23:24 被阅读69次

    一、利用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)

    相关文章

      网友评论

          本文标题:StoryBoard传值

          本文链接:https://www.haomeiwen.com/subject/nuemkttx.html