iphone - How can I switch between UIViewControllers in iOS using Storyboard -


i using storyboards tabbed application. within specific tab need display multiple views. have navigation bar containing 2 buttons (prev , next); when click on next app should display next view(new uiviewcontroller not next tab) , when click on prev app should switch previous view (new uiviewcontroller) without leaving selected tab (the tabbar should stay displayed , same index).

enter image description here

i want change views inside selected tab , 1 have ideas?

well if referring uiview , not uiviewcontrollers, have link view .m file normal ctrl , drag method. create ibaction when button tapped (ctrl drag button , on type tap on action). there method below automatically called when button tapped. have create second view want display , link .m file.

so in method:

{ //view1 view want change, view2 1 want display [_view1 sethidden:true]; [_view2 sethidden:false]; } 

edit: uiviewcontroller

it can done through interface builder. ctrl click on suivant button , drag on new uiviewcontroller. click modal , in new uiviewcontroller place tab bar , top bar. have set them again, did on existing uiviewcontroller. otherwise place navigation controller, in inspector set initial view controller, ctrl drag on tab bar controller in ib , set root view controller. @ least have top bar created you. have edit action of suivant button, doing ctrl click , setting push. did on xcode in quick replication of project , worked perfectly. can avoid repeating creation of tab bar going new uiviewcontoller , doing this:

editor ->embed -> navigation controller 

let me know if works :)


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -