Skip to content

Instantly share code, notes, and snippets.

@terrybu
Created February 22, 2015 17:06
Show Gist options
  • Save terrybu/6ffd7b99544828e6a3d1 to your computer and use it in GitHub Desktop.
Save terrybu/6ffd7b99544828e6a3d1 to your computer and use it in GitHub Desktop.
#import <WebKit/WebKit.h>
@interface ViewController : UIViewController
@property(strong,nonatomic) WKWebView *webView;
@property (strong, nonatomic) NSString *productURL; @end
- (void)viewDidLoad {
[super viewDidLoad];
self.productURL = @"http://www.URL YOU WANT TO VIEW GOES HERE";
NSURL *url = [NSURL URLWithString:self.productURL]; NSURLRequest *request = [NSURLRequest requestWithURL:url];
_webView = [[WKWebView alloc] initWithFrame:self.view.frame];
[_webView loadRequest:request];
_webView.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height); [self.view addSubview:_webView];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment