Skip to content

Commit

Permalink
UIAlertViewDelegate change method called
Browse files Browse the repository at this point in the history
If you want to do a complex action after having dismissed Update alert
view (like show another alert view, also a custom alert view), you
should be 100% sure the previous alert has been completely dismissed.
For that reason, call didDismissWithButtonIndex delegate method instead
of clickedButtonAtIndex method. Already tested in my project with this
complex actions that have to take place. Without this fix, I won’t be
able to se the following alert view.
  • Loading branch information
foffux committed Mar 10, 2015
1 parent 1e2c2e0 commit 49f8852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Harpy/Harpy.m
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ - (UIAlertAction *)skipAlertAction
}

#pragma mark - UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
switch ([self alertType]) {

Expand Down

1 comment on commit 49f8852

@ArtSabintsev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sold on doing this, as didDismissWithButton: gets called even if the device goes to sleep while an alert is visible.

There's a set of delegate methods on Harpy that you can make use of to perform an action after a button is pressed.

I'm more than happy to continue the conversation here, but I'm going to close the PR as I don't agree with this change.

Please sign in to comment.