Swift: unwind segue doesn't work

早过忘川 提交于 2019-12-12 01:52:32

问题


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). When I run it on my iphone and tap Cancel, nothing happens.


回答1:


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.

If that UINavigationController is being called modally, call

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

within the view controller where the button is being pressed.



来源:https://stackoverflow.com/questions/43954996/swift-unwind-segue-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!