What I want to do is that when I come from a 3d shortcut, force the tab bar controller to choose an index.
If I do this in the viewdidAppear()
of the tab bar controller, the problem is that the viewDidAppear()
of my main embedded driver is not called. If I click again on the tab bar item then it is already called.
With the rest of the controllers it does not pass. I understand why it is not the first one in the list of items in the tab bar controller.
Tab bar controller:
override func viewDidAppear(_ animated: Bool) {
if goTasks {
self.selectedIndex = 0
} else if goTodo {
self.selectedIndex = 2
} else if goProjects {
self.selectedIndex = 3
} else if goSearch {
self.selectedIndex = 0
}
}
My index viewcontroller 0.
override func viewDidAppear(_ animated: Bool) {
print(isSearchingServer)
}
If I do debug I can see that it does not get to enter this last viewdidAppear()
.
Any solution?