I'm unable to click hyperlink in UIAlertController. I want to open the external browser on hyperlink click.
-(void)viewDidAppear:(BOOL) animated {
NSString *htmlString = @"Welcom to AlertView for more information <A href=\"https://www.google.com\"> Click Here </A>";
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@""
message:htmlString
preferredStyle:UIAlertControllerStyleAlert];
NSAttributedString *attributedStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUTF8StringEncoding]
options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}
documentAttributes:nil error:nil];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
// OK button tappped.
[self dismissViewControllerAnimated:YES completion:^{ }];
}];
[alert setValue:attributedStr forKey: @"attributedMessage"];
[alert addAction:defaultAction];
[self presentViewController:alert animated:true completion:nil];
}
on click on "Click Here" then should open the external browser. Is possible to get hyperlink click action in UIAlertView?