I want my iOS app to follow a navigation pattern similar to the one shown in Instagram:
That is... if user hasn't signed in, a welcome view is displayed. From there, user can navigate to either the sign in view or the register view. When sign in is successfully completed, the view is dismissed sliding down, and then the main app view is shown below. If user logs out, the welcome view is shown again.
My app is also a tabbed one. I've set the rootViewController
in AppDelegate
to be the UITabBarController
, and I tried showing the welcome > sign in / welcome > register navigation hierarchy by presenting its UINavigationController
from the main view in the UITabBarController
(that, as I said, is the rootViewController
). But the problem is that, for presenting the welcome view from the main view, I need to show the main view first, even if the user has not logged in yet. And I don't want the user to see the main view if not logged in.
I also tried checking if user is already logged in at the start of the app, and if log in required, populating the UITabBarController
that is the rootViewController
with the welcome view and hiding the tab bar. Then presenting the sign in view from there, and dismissing it if log in is succesful and populating at this point the UITabBarController
with the main view and the rest of the tab items of my app. But here the problem is that, when I dismiss the sign in view, the welcome view is shown below before the main view and the rest of tab items are loaded. And I neither want the user to see again the welcome view when the sign in view is dismissed, I want to show the main view directly, as Instagram does.
How could I achieve a behaviour like in Instagram?
Thanks in advance