dimanche 19 juin 2016

viewWillAppear of parent triggered when second presented viewcontroller dismissed


I have 3 viewcontrollers let's say AVC, BVC and CVC

First I present BVC from AVC and then present CVC from BVC

So the hierarchy would be AVC->BVC->CVC.

When I dismiss CVC from BVC, viewWillAppear of AVC is triggered, how can I prevent viewWillAppear of AVC getting called?

Thanks

UPDATE
First present (in AVC)

BTViewController *BTVC = [self.storyboard instantiateViewControllerWithIdentifier:@"BTVCIns"];
__weak BTViewController *weakBTVC = BTVC;
BTVC.dismissAction = ^{[weakBuyTicketVC dismissViewControllerAnimated:YES completion:nil];};
[BTVC setModalPresentationStyle:UIModalPresentationOverCurrentContext];
[self presentViewController:BTVC animated:YES completion:nil];

Second present (in BVC)

PMViewController *PMVC = [self.storyboard instantiateViewControllerWithIdentifier:@"PMVCIns"];
__block PMViewController *blockPMVC = PMVC;
blockPMVC.dismissAction = ^{[blockPMVC dismissViewControllerAnimated:YES completion:nil];};
blockPMVC.delegate = self;
[self presentViewController:PMVC animated:YES completion:nil];

Aucun commentaire:

Enregistrer un commentaire