josshad / EHPlainAlert

Plain style IOS alert
MIT License
46 stars 18 forks source link

Detect if alert is pressed? #8

Closed remotewhiteboard closed 6 years ago

remotewhiteboard commented 7 years ago

Is there a way to detect if they pressed on the alert, and then send them somewhere?

josshad commented 7 years ago
EHPlainAlert * ehAlert = [[EHPlainAlert alloc] initWithTitle:@"Hmm..." message:@"Tap for information" type:ViewAlertInfo];
ehAlert.action = ^{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/josshad/EHPlainAlert"]];
};
ehAlert.messageColor = [UIColor blueColor];
ehAlert.iconImage = nil;
[ehAlert show];

This example will open safari on tap.