Skip to content

Instantly share code, notes, and snippets.

@toshi0383
Created October 27, 2015 14:27
Show Gist options
  • Select an option

  • Save toshi0383/f46b95582d4feea4edfd to your computer and use it in GitHub Desktop.

Select an option

Save toshi0383/f46b95582d4feea4edfd to your computer and use it in GitHub Desktop.
tvOSでWebView動きましたん。 #CodePiece
#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