问题
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