Using unwind segue-Study Notes

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.

  1. unwind segue穿越你的navigation hierarchy来确定destination view controller的所在。
  2. 接收到prepareForSegue:sender方法的view controller会初始一个unwind segue。默认来说这个操作什么都不会做。但你可以重写方法让它向目标vc传递数据。
  3. 目标vc的unwind action被调用。
  4. 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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容