xcode iOS Storyboard 呈现 Segues“关系、嵌入、推送、模态、自定义”类型
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26518968/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS Storyboard Presenting Segues "relationship, embed, push, modal, custom" types
提问by CarlGammaSagan
I have a basic idea what push and modal segues do. Push is used for Navigation Controller segues and Modal is the default one I've been using so far for a basic segue into another View Controller. I assume "modal" means nothing else can be going on/interrupting the segue?
我对 push 和 modal segue 的作用有一个基本的了解。Push 用于导航控制器转场,而 Modal 是我迄今为止一直使用的默认转场,用于基本转场到另一个视图控制器。我认为“模态”意味着没有其他事情可以进行/中断转场?
Custom segues I guess are the most flexible/customizable/animatable.
我猜自定义转场是最灵活/可定制/可动画的。
I have no idea what "relationship" and "embed" segues do. Please let me know!
我不知道“关系”和“嵌入”segue 是做什么的。请告诉我!
Thank you.
谢谢你。
回答by rdelmar
A "relationship" segue is the segue between a container view controller and its child or children -- so, the initial controller of a navigation controller, the view controllers in the tabs of a tab bar controller, and the master and detail controllers of a split view controller.
“关系”转场是容器视图控制器与其子项或多个子项之间的转场——因此,导航控制器的初始控制器、选项卡栏控制器的选项卡中的视图控制器以及主控制器和细节控制器拆分视图控制器。
An "embed" segue is the segue between a container view and the controller that's embedded in that container view that you get automatically when you add a container view to a controller's view.
“嵌入”转场是容器视图和嵌入在该容器视图中的控制器之间的转场,当您将容器视图添加到控制器视图时,您会自动获得该转场。
Both of these segues are executed as soon as the parent controller gets instantiated. You do not call them, but you can implement prepareForSegue, and pass information to the destination view controller.
一旦父控制器被实例化,这两个 segue 就会被执行。您不调用它们,但您可以实现 prepareForSegue,并将信息传递给目标视图控制器。