Reputation: 4155
I am trying to build an app that has a landing screen with a link to either "signin" page or "sign up" page. The meat of the app is a tabbar. Where would be the right place to implement the tabbarcontroller given that a user can have the following flow:
Is it possible to do that in the AppDelegate? But then, how do I go back to the appDelegate if I am at the "sign in"/"sign up" page?
Thanks so much for the help!!
Upvotes: 0
Views: 137
Reputation: 4399
Create a modal view that pop ups (the landing page) if the user is not signed in/up. Once they either sign in or sign up, you dismiss the view.
Just create another view and the xib, and if you the first view you load detects they are not logged in (example: say you have a tab bar with Twitter Feed, Facebook Feed, and SO feed, your first view is the twitter view, it senses you aren't signed up/logged in for your awesome service, it calls a modal view to sign in/up) Once users are done with this you dismiss the modal view.
Here's the official documentation: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html
UINavigationController *loginview = [[UINavigationController alloc]init];
[self presentModalViewController:loginview animated:YES];
To dismiss it (from within the login view)
[self dismissModalViewControllerAnimated:YES];
Upvotes: 1
Reputation: 12325
For Landing Page / Sign in / Sign Up Page use a seperate view controller (For example) LoginViewController
and set it as a ModalViewController
in the viewDidLoad
of your first tab of your tabbarcontroller
.
If login is successful, pop
the modalViewController
, and you will have the tabBarController.
If you need to know the implementation of this, go to this link -> -> Show / Hide tab bar
Upvotes: 1