The Unwind Process:
This section describes the process that occurs just after an unwind segue is initiated, either by the user interacting with a control in a scene or your code sending a performSegueWithIdentifier:sender: message to a view controller.
- unwind segue穿越你的navigation hierarchy来确定destination view controller的所在。
- 接收到
prepareForSegue:sender
方法的view controller会初始一个unwind segue。默认来说这个操作什么都不会做。但你可以重写方法让它向目标vc传递数据。 - 目标vc的unwind action被调用。
- unwind segue执行源vc和目标vc之间的视觉上的转换。
[1.The unwind segue traverses your navigation hierarchy to locate the destination view controller. This step is described in detail under How an Unwind Segue Determines its Destination View Controller.
2.The view controller that initiated the unwind segue is sent a prepareForSegue:sender: message. The default implementation does nothing. Your view controller can override this method to pass data to the destination view controller.
3.The destination view controller's unwind action is invoked.
4.The unwind segue animates the visual transition between the source and destination view controller.]
https://developer.apple.com/library/content/technotes/tn2298/_index.html