prepareSegue场景切换
ide
使用prepareSehue在navigation中切换场景,要实现两个方法 ,下面图片是所使用的过渡链接的方法函数
一、在FirstViewContorller中布局
@IBAction func toFirstSegue(segue: UIStoryboardSegue) { // TODO *** }
toFirstSegue是本身定义的一个动做,当SecondViewContorller返回到FirstViewContorller的时候就会调用这个方法,spa
二、SecondViewContorller中code
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { }
要把这个函数重写。图片
而后再布局文件中拖住取消到eist会弹出返回到登录界面的action Segue选择你须要的,而后就能够实现一个从下面弹出而后点击取消又返回到第一个ViewContorller中的效果了io