Unwind segue and nav button items not triggering after tab bar controller added

纵饮孤独 提交于 2019-12-10 22:30:17

问题


I'm trying to implement an unwind segue that will take me from the last view controller back to the todo-list controller.

Here's my storyboard

Without the tab bar controller, the unwind segue works fine. However, as soon as I add the tab bar controller, the unwind stopped triggering.

What am I doing wrong?

Thanks

Edit: Also, actions created on the bar button in the last view controller do not trigger when the tab bar controller is implemented


回答1:


I have had a similar situation and I was able to resolve it by setting the Modal segue to "Presentation: Current Context" instead of "Default" in the Attributes Inspector (screenshot here: https://cloudup.com/cHFyH8OOY9D).

That is, the segue arrow between the Table View and the second Navigation Controller in your screenshot above.




回答2:


I've had a similar issue with unwind segues not being called with view controllers within a TabBarController.

The solution is to create a custom TabBarController class, and have the unwind segue action in that class. You will then be able to pass a message to the current tab bar view controller.



来源:https://stackoverflow.com/questions/24659845/unwind-segue-and-nav-button-items-not-triggering-after-tab-bar-controller-added

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