I have a function in my menuViewController to log out the user and return to the "main" login window. When I press the push button in my menu this works just fine. However, if I listen for a logout broadcast message and then try to call the same code in my menuViewController, revealViewController() comes back as nil?
var controller: UIViewController?
controller = storyboard.instantiateViewController(withIdentifier: "MainViewController")
if (controller != nil) {
let nc = UINavigationController(rootViewController: controller!)
revealViewController()!.pushMainViewController(nc, animated:true) <-- Fails
}
I have a function in my menuViewController to log out the user and return to the "main" login window. When I press the push button in my menu this works just fine. However, if I listen for a logout broadcast message and then try to call the same code in my menuViewController, revealViewController() comes back as nil?