0

I'm trying to change ViewControllers within a viewWillAppear method of a view nested inside a SWRevealViewController, and viewWillAppear is not being called on the new view. Is this bad practice, and is there a way around it?

My view hierarchy looks like this:

  • Root Window
    • SWRevealViewController
      • Rear Controller
      • Login View Controller
        • Sign Up Controller

Basically, when the sign up is completed, the account details are set in the app delegate, and the sign up controller dismisses itself. The login view controller's viewWillAppear method is then called, and it sees that the user is now logged in, thus replacing itself as the SWRevealController's front controller with the "main" screen.

However, the main screen's viewWillAppear method is never called.

JustinHK
  • 758
  • 1
  • 6
  • 19
  • did the 'main' screen actually come out on screen? how do you replacing itself as the SWRevealController's front controller with the "main" screen? post the code if possible – Wingzero Dec 18 '15 at 02:00
  • The signup view controller dismisses itself, then the LoginViewController, inside `viewWillAppear` sets `self.revealViewController.frontViewController = mainViewController;` Everything appears as expected, but the mainViewController does not have `viewWillAppear` called. All other lifecycle methods are called (`viewDidAppear`, etc). – JustinHK Dec 18 '15 at 15:16

0 Answers0