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