简体   繁体   English

斯威夫特(Swift):放松Segue无效

[英]Swift: unwind segue doesn't work

I'm stuck with unwind segue that doesn't work for some reason, I do everything as described in tutorial: cntrl drag to exit and select unwind action from another controller (please see gif attached). 我受制于因某种原因而无法正常工作的展开功能,我按照教程中的说明进行了所有操作:cntrl拖动以退出并从另一个控制器中选择展开操作(请参阅随附的gif)。 When I run it on my iphone and tap Cancel, nothing happens. 当我在iPhone上运行它并点击“取消”时,没有任何反应。 描述

It looks like the view controller you're trying to unwind from is already the bottom of the UINavigationController 's stack, so it's not going to do anything when the unwind is called. 看来您要从中展开的视图控制器已经在UINavigationController堆栈的底部,因此调用展开时它不会做任何事情。

If that UINavigationController is being called modally, call 如果该UINavigationController被模态调用,则调用

self.navigationController?.dismiss(animated: true, completion: nil)

within the view controller where the button is being pressed. 在按下按钮的视图控制器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM