Actually you cannot. no notice (apple not working well).
But there is a solution:
use viewDidAppear, viewWillAppear, viewWillDesappear, viewDidDesappear family in the viewController that called the presentModalViewController function
Idea:
.h:
BOOL hasModal;
.m:
-(void)presentModal { hasModal = YES; [self presentModalViewController:_viewController animated:YES]; } -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; if(hasModal) {
Good luck ^^
source share