Last active
October 17, 2015 13:32
-
-
Save sjg/70099957a1ccb75df683 to your computer and use it in GitHub Desktop.
Programatic WebView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
CGRect screenRect = [[UIScreen mainScreen] bounds]; | |
CGFloat screenWidth = screenRect.size.width; | |
CGFloat screenHeight = screenRect.size.height; | |
UIWebView *webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight )]; | |
NSString *url=@"https://google.com/"; | |
NSURL *nsurl=[NSURL URLWithString:url]; | |
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl]; | |
[webview loadRequest:nsrequest]; | |
[self.view addSubview:webview]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment