UIWebView - Full Browser! To open the url in webView you do this -
NSURL *url = [NSURL URLWithString:webAddress]; NSURLRequest *req = [NSURLRequest requestWithURL:url]; [webView loadRequest:req];
You can even insert javascript into a UIWebView . You can customize it to your liking.
//To customize the look & feel... self.webView.scalesPageToFit = YES; self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; self.webView.autoresizesSubviews = YES; //To insert Javascript NSString *jsCommand = [NSString stringWithFormat:@"document.body.style.zoom = 0.5;"]; [self.webView stringByEvaluatingJavaScriptFromString:jsCommand];
You could do a lot more. Enjoy...
UPDATE: To get the back button and thatβs it, webView provides these functions, back, forward, etc. all of these browser features. You need to encode the buttons and the user interface, and for the code you can do this -
-(IBAction)goForward:(id)sender { [webView goForward]; } -(IBAction)goBack:(id)sender { [webView goBack]; } -(IBAction) gotoHome:(id)sender { NSString *urlAddress = @"http://google.com"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; }
source share