Niharika Niharika - 1 month ago 7
iOS Question

Convert URL into hyperlink

I am working on a app in which I am sharing event image with some url
When sharing the event image I am using this content :=

"Hey! I just saw "Venue Name" is having "Event Name" through the XXXX App! We
should check it out."

Now can I make this "" link to hyperlink "here"?

I am sharing this content via "UIActivityViewController".
Actually this URL ( is used for deep linkling later on when user click this it will be redirect to particular event depend on the event_id.
Instead on the whole URL I want to use here(as hyperlink) only.

Answer Source

might be help you this way..

NSString *url=@"";
    NSString * title =[NSString stringWithFormat:@"Hey! I just saw \"Venue Name\" is having \"Event Name\" through the XXXX App! We should check it out <html> <body> <a href = '%@'>here</a> </body> </html>",url];
    NSArray* dataToShare = @[title];
    UIActivityViewController* activityViewController =[[UIActivityViewController alloc] initWithActivityItems:dataToShare applicationActivities:nil];
    activityViewController.excludedActivityTypes = @[UIActivityTypeAirDrop];
    [self presentViewController:activityViewController animated:YES completion:^{}];