Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

presentViewController:animated:NO briefly shows presenting controller in iOS 8. Alternatives?

It's typical during app startup to create your main UI structure, but during if user is not logged in during app launch, to immediately present a modal intro/login screen above the normal UI.

Normally it has been fine to present the modal UI using presentViewController:animated:NO, because the user would see: App Launch Image -> Login UI.

However, on iOS 8, it seems calling presentViewController with animated = NO still briefly shows the underlying view controller for a frame before presenting the view controller.

Example:

I don't want to present the login UI first, because when the user logged in I'd be presenting the main UI from the login UI, thus keeping the login UI around in the hierarchy indefinitely.

Is there another way I haven't considered? Could storyboards help me here?

like image 972
Rizwan Sattar Avatar asked Sep 30 '22 11:09

Rizwan Sattar


1 Answers

Personally I check for logged in status on application launch, and then either install the login view controller or the main root view controller as the window's root view controller.

When the user logs in or out, the window's root view controller is replaced. This can be animated as well. I find this approach quite clean.

like image 145
jrturton Avatar answered Oct 03 '22 02:10

jrturton