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


source to share





All Articles