Swfit Storyboard跳转和传值

Swfit Storyboard跳转和传值_第1张图片
Storyboard

转场

  1. 直接使用StoryBoard连接
  2. 设置identifier情况下->   performSegueWithIdentifier("segue", sender: self)

传值

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    if segue.identifier == "segue"  { //如果有多个identifier需要判断
    let secondVC  = segue.destinationViewController as SecondViewController
    secondVC.value = self.value
    }
}

你可能感兴趣的:(Swfit Storyboard跳转和传值)