Search code examples
iosobjective-cnsurl

Opened Safari by pressing a button, how i can come back to my app


I am new to iOS and objective C. I have to create a simple app where user will press a button and as a result, app will open safari. Then user have to come back to my app again. I have opened safari but I don't know how to bring user back to my app. I have used this simple code:

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

Any suggestion that how I can do that?


Solution

  • When you open a URL using

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

    Your OS takes care of loading a new application. Instead if you wanna load a web URL use apple's UIWebView class.