开发者

navigating to a TabBar from different ViewControllers

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 flo开发者_如何转开发w:

  1. landing page - >sign in -> main app
  2. landing page - > sign up -> main app
  3. straight to main app if the user logged in already

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!!


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];


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜