iphone - Dimiss two ViewControllers one after the another:iOS -
i trying dismiss 2 view controllers 1 after another, in first view controller have kept uploading feature, when completes current view controller dismissed.
now, after uploading viewcontroller dismissed,i come previous viewcontroller. want dismiss "previousviewcontroller" well.
after "uploadviewcontroller" dismissed, call method on "previousviewcontroller"
here how trying it:
in uploadviewcontroller:
[self dismissviewcontrolleranimated:yes completion:^{ [previousview dismissme]; }];
and when come "previousviewcontroller"
here dismissme
method:
-(void)dismissme { if (![[self presentingviewcontroller] isbeingdismissed]) { nslog(@"dismiss me"); [self dismissviewcontrolleranimated:yes completion:null]; } }
i "dismiss me" log, viewcontroller not being dismissed.
any ideas .. ? how achieve ..?
this code helps in dismissing previous 2 viewcontrollers.
[[[self presentingviewcontroller] presentingviewcontroller] dismissmodalviewcontrolleranimated:yes];
Comments
Post a Comment