Skip to content

Instantly share code, notes, and snippets.

HaifaCarina HaifaCarina

View GitHub Profile
@HaifaCarina
HaifaCarina / LocalHTMLApp.m
Created Dec 1, 2012
UIWebView implementation that loads content from from a local html file in the Xcode project.
View LocalHTMLApp.m
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
webView.autoresizesSubviews = YES;
webView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
webView.dataDetectorTypes = UIDataDetectorTypeLink;
webView.backgroundColor = [UIColor redColor];
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[self.view addSubview:webView];
You can’t perform that action at this time.