ios - Pushing a navigation controller after a modal view controller is presented -
i have tab view controller has button , when gets pressed modal appears:
postviewcontroller *post = [[postviewcontroller alloc] init]; // [self.navigationcontroller pushviewcontroller:post animated:yes]; // presentation [self presentviewcontroller:post animated:yes completion:nil];
when modal done want dismiss , force new view controller so:
profilesviewcontroller *profile = [[profilesviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:profile animated:yes];
but can't in post vc modal. how do this?
you can seek using completionblock
.
completionblock
called when presentviewcontroller done.
postviewcontroller *post = [[postviewcontroller alloc] init]; [con presentviewcontroller:post animated:yes completion:^{ profilesviewcontroller *profile = [[profilesviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:profile animated:yes]; }];
more info presentviewcontroller:animated:completion:
apple doc
completion : block execute after presentation finishes. block has no homecoming value , takes no parameters. may specify nil parameter.
ios uiviewcontroller uinavigationcontroller uitabview
No comments:
Post a Comment