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?
Inside your IBAction method, include the line
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
If you use interface builder :
Create a UITextView and not a UIButton, write the link as text to textview and select the links checkbox in the interface builder. It will become the link you want at run time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With