Answer the question
In order to leave comments, you need to log in
How to access UITabBarController from external controller?
The essence of the problem is as follows, there is an application with tabs, when you click on one of the tabs, the login controller opens, through the storyboard by id
And after closing it, I need to switch the tab, for example, to the second one programmatically ...
I tried like this: self.tabBarController?.selectedIndex = 1
and like this:
let TBC: UITabBarController = self.storyboard?.instantiateViewControllerWithIdentifier("TBC") as! TabBarController
TBC.selectedIndex = 1
Answer the question
In order to leave comments, you need to log in
It is possible, and even better, to pass the login to the controller block to complete. And when your popup controller is done, it will execute the corresponding block.
UPD.
1) Add a clajour variable to your popup:
2) When creating a popup, add a callback to it:
popup.callback = {(successful:Bool)->Void in
if successful {
// something
} else {
// something
}
}
if let callback = callback {
callback(successful: true)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question