Reputation: 1201
Where can I find a simple compilable example on how to create and use a UIWebView?
Any non-interface builder examples?
Upvotes: 13
Views: 33656
Reputation: 101
WebView - Add the Delegate
@property (strong, nonatomic) IBOutlet UIWebView *WebView;
NSString *fullURL = @"http://facebook.com/";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_WebView loadRequest:requestObj];
Upvotes: 1
Reputation: 32793
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[webView setDelegate:self];
NSString *urlAddress = @"http://www.google.com/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
Upvotes: 36