ios - Using storyboards to navigate a complex set of views, unwind segue is not enough -


enter image description herei have storyboard looks attached image.

the idea there 3 portrait views, showing current consumption, through user can navigate swiping left. i'm using left swipe gesture recognisers this. add right swipe gesture recognisers , connect unwind segue go back. works fine.

the order [both electricity & gas] -> [electricity] -> [gas].

each portrait view has corresponding landscape detail view. these set user can navigate swiping, , unwind segues can swipe back. again order [both graph] -> [electricity graph] -> [gas graph].

i want user able move portrait view corresponding detail view rotating device. spot rotation in each of portrait controllers, , programmatically perform segue, (for gas). (note code isn't robust against correct orientation yet, while i'm experimenting.)

- (void)willrotatetointerfaceorientation:(uiinterfaceorientation)atointerfaceorientation duration:(nstimeinterval)aduration {      [self performseguewithidentifier: @"seguegastolandscape" sender:self]; }  

so, example, user might swipe twice view gas portrait page, , rotate device see detailed graph of gas consumption.

from here, i'd user able swipe right see electricity detail graph, , right again graph both - won't happen, method doing unwind swipe has not happened. (and in fact landscape electricity view controller not instantiated @ point.)

what think need not use unwind segues, instead use normal segues throughout. want without creating new instantiations existing controllers (as unwind segues do) create new instantiation if needed (as unwind segues don't).

if matters, i'm happy code ios 6.1 , above.

has done this?

sounds want use instantiateviewcontrollerwithidentifier: dont forget set storyboard id of receiving view controller.

if (!self.homevc) {     self.homevc = [self.storyboard instantiateviewcontrollerwithidentifier:@"homeview"];     [self presentviewcontroller:self.homevc animated:yes completion:nil]; } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -