ios - How to unwind segue several steps back? -
there lot of stuff on net according topic don't it. have app custom segue
implementation , without navigation controller
. there cases in need unwind several steps.
for implementation utilize simple calls:
code custom segue
for wind:
[[self sourceviewcontroller] presentmodalviewcontroller:[self destinationviewcontroller] animated:yes];
for unwind:
[[self destinationviewcontroller] dismissviewcontrolleranimated: yes completion: nil];
as understand when wind segue
somewhere in memory there info used during unwind. reason in custom unwind utilize read property destinationviewcontroller
.
so how can unwind several steps in 1 action? or have create several unwinds in different view controllers
?
i read next question, don't understand implementation.
bellow set illustration of apps logic:
example
i have 4 vc in chain: vc a -> vc b -> vc c -> vc d
i wind , unwind , forth. logic ok. there situation in need unwind vc d vc b. how that? can unwind straight vc b or have unwind vc c , in unwind handler unwind vc b?
i thought of additional segue vc d vc b, there remarks on net not right way, because segue chain messy.
the reply what unwind segues , how utilize them? has need know unwindsegues (i suggest re-read it).
but more direct answer, yes can unwind vc d vc b. have first implement method in vc b:
- (ibaction)unwindtovcb:(uistoryboardsegue *)unwindsegue { }
after doing so, go ib, , control-drag button's action exit icon, should pick method created above selector. (this taken straight question/answer stated above).
again, clearer version of said, read reply of linked question mentioned above.
ios objective-c
No comments:
Post a Comment