Search code examples
iosxcodemobile-safari

iOS: create a link button


I want to create an IBAction for a button, that when you push it, the app go in background and at the same time open safari at a specific link (example "www.google.it") Can you help me?


Solution

  • Inside your IBAction method, include the line

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];