When using a nav controller and tab bar, why does makeMove only fire once?

This is the setting I am trying to work with:

enter image description here

As you can see, the structure looks like this:

Navigation Controller> View Controller> Tab Bar Controller> View Controller

I am trying to pass data through the back button and generally all I have to do is fire didMove

from the view controller with the back button:

override func didMove(toParentViewController parent: UIViewController?) {
    if (!(parent?.isEqual(self.parent) ?? false)) {
        print("Parent view loaded")
    }
}

      

However, when I put this inside TabItem01ViewController.swift

or TabItem02ViewController.swift

, nothing gets triggered. If I put the code in TabViewController.swift

, however, it didMove

will run. I can't seem to figure out why it gets fired from TabViewController.swift

but not from tab views.


So my question is , how do I pass data from one of the tabs to a file ViewController.swift

when the back button is pressed?

+3
ios swift uitabbarcontroller viewcontroller uitabbar


source to share


No one has answered this question yet

Check out similar questions:

275
Best Practices for Storyboard Logging Screen, Handling Data Cleansing on Logout
79
Tab bar controller inside navigation controller, or share root navigation bar
31
How to properly implement a tab bar controller with a navigation controller
2
Navigation controller with tab bar controller?
1
Toggle tab bar display in subview software (custom tab bar controller)
1
When I navigate from view back to tab bar controller the tab bar does not show
0
How to make a back button in a nav controller when the tab bar is the initial view controller
0
Navigation bar not accessible from tab bar controller
0
Why does nesting a view controller in a navigation controller and then in a control bar bind the nav bar to a tab bar controller?
0
Why does Tab Bar Controller include ViewController in View?



All Articles
Loading...
X
Show
Funny
Dev
Pics