Closed shmidt closed 10 years ago
Hi - the 'cancelBlock' is called in the same situations as the UIAlertViewDelegate - (void)alertViewCancel:(UIAlertView *)alertView
method.
In Apple's documentation:
An alert view can be canceled at any time by the system—for example, when the user taps the Home button. The alertView:willDismissWithButtonIndex: and alertView:didDismissWithButtonIndex: methods are invoked after this method.
I know it's a little confusing - if you wanted to do something on the user tapping the cancel button, the check would occur in the tap block, e.g.
av.tapBlock = ^(UIAlertView *alertView, NSInteger buttonIndex) {
if (buttonIndex == alertView.cancelButtonIndex) {
NSLog(@"Cancel button tapped.");
} else {
...
}
};
I've updated the example project to use this example.
Thank you :+1:
Hi,
I tried your code in test sample and see that
cancelBlock
is never called.