Skip to content

Instantly share code, notes, and snippets.

@romyilano
Forked from kwylez/gist:1348851
Created November 24, 2013 20:17
Show Gist options
  • Save romyilano/7631938 to your computer and use it in GitHub Desktop.
Save romyilano/7631938 to your computer and use it in GitHub Desktop.
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
webView.delegate = self;
webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
NSURL *htmlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"]isDirectory:NO];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(queue, ^{
NSURLRequest *request = [NSURLRequest requestWithURL:htmlPath];
[webView loadRequest:request];
dispatch_sync(dispatch_get_main_queue(), ^{
[self.view addSubview:webView];
[webView release];
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment