當我們需要去獲取UINavgationController的退出事件,可在viewWillDisappear用如下方法實現。
代碼:
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if (![[self.navigationController viewControllers] containsObject:self])
{
NSLog(@"用戶點擊了返回按鈕");
}
}