Guest User

confrmActionsheet

a guest
May 2nd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
  2.    
  3.     if (editing && [viewController isEqual:tabBarController.viewControllers[0]]) {
  4.         //confirm
  5.         confirmExit = [[UIActionSheet alloc] initWithTitle:@"You have unsaved changes, are you sure you want to continue?" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"YES" otherButtonTitles:nil, nil];
  6.    
  7.         [confirmExit showFromTabBar:self.tabBarController.tabBar];
  8.         return NO;
  9.     } else {
  10.         return YES;
  11.     }
  12.    
  13. }
Advertisement
Add Comment
Please, Sign In to add comment