[英]Which segue should I use to show a view controller vertically?
First and foremost i'm still new to Swift so please bear with me. 首先,我还是Swift的新手,所以请多多包涵。 Say i'm at view controller A (which is the root view controller in the navigation hierarchy) and I want view controller B to appear as a popup (cover the entire screen).
假设我在视图控制器A(这是导航层次结构中的根视图控制器)上,并且我希望视图控制器B出现为弹出窗口(覆盖整个屏幕)。 I want that popup and to remain part of the navigation hierarchy.
我希望该弹出窗口并保留在导航层次结构中。 Then from that popup push to view controller C with a horizontal transition.
然后从该弹出窗口中推送到具有水平过渡的视图控制器C。 How would I do this?
我该怎么做? I am using segues.
我正在使用segues。 I just don't know which segue to use.
我只是不知道该使用哪个序列。 Should I use a modal or popover segue to go from view controller A to view controller B?
我应该使用模态或弹出窗口搜索从视图控制器A转到视图控制器B吗? Or should I simply use a push segue and use a custom transition?
还是我应该简单地使用推送搜索并使用自定义过渡? I'd prefer not to use a custom transition but let me know what you think.
我不希望使用自定义过渡,但请告诉我您的想法。
将ViewController B嵌入到导航控制器中,然后模态显示导航控制器。
Use the below code to present the VC from bottom. 使用下面的代码从底部显示VC。
let alertVC = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CustomAlertViewController") as! CustomAlertViewController
alertVC.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
self.present(alertVC, animated: true, completion: nil)
Then further use push for other VC's 然后进一步将push用于其他VC
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.