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 

storyboard layout

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.

enter image description here

for uitablebarcontroller give name identity storyboard identer image description here

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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -