ios - Example for login screen modally based on storyboard -
i learning ios/ xcode , @ roadblock.
i have tabbarcontroller+navigation based design. need present login screen if user not logged in. here basic heirarchy. login page needs navigationbar (as tutorial followed puts "go" button on bar.
logincontroller: (ltcontroller.h,.m) main view:tabbarcontroller> navigationcontroller>view1>view1a navigationcontroller>view2
i read lot of posts here on modal view, delegate method, etc. of them code snippets unfortunately bit on head beginner level.
would appreciate simple explanation how achieve this. espacially note on files needs changes great.
thanks
here scenario . simple . hope useful.
for uitablebarcontroller give name identity storyboard id
then in viewcontroller class file have authentication credentials right >.? stuff on there authentication . follow code . works fine
- (ibaction)login:(id)sender { if(authenticated) // authenticated---> bool value assign true if login success { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; uitabbarcontroller *obj=[storyboard instantiateviewcontrollerwithidentifier:@"tab"]; self.navigationcontroller.navigationbarhidden=yes; [self.navigationcontroller pushviewcontroller:obj animated:yes]; }
Comments
Post a Comment