简体   繁体   中英

Unwind in Xcode 7 Using Swift 2 Does not Work

I have two View Controllers. In the second View Controller, I have a button called "Gidelim". I want it to turn back to the first View Controller when I click on it.

For this purpose, I have defined a func in the first View Controller's as below:

The Unwind Segue

The func "YeniVCAc" shows the second View Controller and it works. The func "ilkVCGit" has to return back to this View Controller.

I have CTRL-dragged the button to the Exit on the second view controller. Then I have chosen ilkVCGit.

This design must be correct as I think. However, the application crashes when I press the button on the second view controller.

Connect your button in the Interface Builder to this Action, in the class of your SecondViewController:

@IBAction func dismiss(sender: AnyObject) {
    self.dismissViewControllerAnimated(true, completion: nil)
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM