Iphone SDK dismissing Modal ViewControllers on ipad by clicking outside of it
I’m a year late, but this is pretty straightforward to do. Have your modal view controller attach a gesture recognizer to the view’s window: UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapBehind:)]; [recognizer setNumberOfTapsRequired:1]; recognizer.cancelsTouchesInView = NO; //So the user can still interact with controls in the modal view [self.view.window addGestureRecognizer:recognizer]; [recognizer release]; The handling code: … Read more