Created
October 27, 2015 14:27
-
-
Save toshi0383/f46b95582d4feea4edfd to your computer and use it in GitHub Desktop.
tvOSでWebView動きましたん。 #CodePiece
This file contains hidden or 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
| #import "ViewController.h" | |
| @interface ViewController () | |
| @property (nonatomic) id webview; | |
| @end | |
| @implementation ViewController | |
| - (void)viewDidLoad { | |
| [super viewDidLoad]; | |
| _webview = [[NSClassFromString(@"UIWebView") alloc]initWithFrame:self.view.frame]; | |
| NSURL *url = [NSURL URLWithString:@"https://www.google.com/"]; | |
| NSURLRequest *req = [NSURLRequest requestWithURL:url]; | |
| [self.view addSubview:_webview]; | |
| [_webview performSelector:@selector(loadRequest:) withObject:req afterDelay:0]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment