xcode - How to decide dynamically which screen to transition to (iOS Game) -
i'm little bit confused how best perform screen transitions in game. need perform following transitions [main menu] -> [character select] -> [stage select]
up until using interface builder "click 'n drag" control in [main menu] [character select] , choosing modal segue type. realized that, on second run of game, player doesn't need go [character select] screen again. i'd have following flow [main menu] -> [stage select]
so question(s) are:
1) modal transition recommended way of doing this? examples saw using modal transitions popup or similar. don't want use navigation bars because think not design options game.
2) saw somewhere should not use segues here, instead i'd use "presentviewcontroller:animated:completion:" led me set of questions.
3) in order understand presentviewcontroller... ended in apple doc http://developer.apple.com/library/ios/#featuredarticles/viewcontrollerpgforiphoneos/modalviewcontrollers/modalviewcontrollers.html not explain many things,
3.1) instance how set nib file name of controller in inteface builder? (do have create .xib file). nib/xib file confusing.
i tried pass in name of controller class nib name this:
mycontroller* controller = [uiviewcontroller alloc] initwithnibname:@"mycontroller"...
but exception "could not load nib in bundle..."
3.2) document states should set controller.delegate self uicontroller not have delegate property. have define delegate property in presented controller myself?
3.3) second argument, "bundle", should pass in 'nil' or should pass in mainbundle?
thanks in advance.
you should use segue call to:
- (void)performseguewithidentifier:(nsstring *)identifier sender:(id)sender
when want perform [main menu] -> [stage select]
transition. create segue in uiviewcontroller subclass, configure it, , use needed.
alternately, in view have uicontrol
[main menu] -> [character select]
could:
- change segue performs
- disable , hide while enabling , unhiding control
menu->stage
segue