You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What specifically is the issue? If you want to know whether the cancel button was tapped check for KDIUIAlertControllerCancelButtonIndex within the completion block.
if (buttonIndex == KDIUIAlertControllerCancelButtonIndex) {
// cancel button was tapped
}
else {
// check other indexes, starting at 0 - (count of other titles - 1)
}
buttonIndex = -1 when click cancel button, buttonIndex = 0 when click other button. So current workaround way is [buttonIndex+1]
[UIAlertController KDI_presentAlertControllerWithTitle:@"Sign Out?" message:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@[@"Sign Out"] completion:^(__kindof UIAlertController * _Nonnull alertController, NSInteger buttonIndex) {
if (alertController.actions[buttonIndex+1].style != UIAlertActionStyleCancel) {
//do something
}
}];
The text was updated successfully, but these errors were encountered: