how to open a web page in self window on button click for IOS

I want to open a web page when button is clicked.. with multiple button s and multiple wwebpage urls.. so, how to open a webpage in self window not separeted from main.storyboard file.. can you please anyone provide me a solution..

still waiting for reply...

I do not understand what you mean by `self window not separeted from main.storyboard` .

And show us what you have done till now. Sort of "Tell me everything I need" questions may not get good replies...

self window means within storyboard, i need to open a web page.. But it opened once i clicked UIButton and redirects into specified url


I used below code..


- (IBAction)buttonA:(id)sender {

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

}


After specified url opened i can't able to go back to my main.storyboad page.....

You should probably create and present a SFSafariViewController to keep the user in your app. Sorry I can't provide any sample code but that's the class you will probably want to use.

As you see, `openURL:` just invokes the best app fit for the scheme, and usually Safari is chosen for "http:".


Consider using SFSafariViewController, which works as "Safari in your app".

It is not so easy as just calling openURL, but you can find many articles on the web searching with "SFSafariViewController".

how to open a web page in self window on button click for IOS
 
 
Q