Created
February 4, 2013 01:18
-
-
Save bitwit/4704528 to your computer and use it in GitHub Desktop.
The Objective-C ViewController from my blog entry An iOS5 Ready Native Web App Template http://www.bitwit.ca/blog/an-ios5-ready-native-web-app-template/
This file contains 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 <UIKit/UIKit.h> | |
#import "WebViewController.h" | |
@interface ViewController : WebViewController | |
@end |
This file contains 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" | |
@implementation ViewController | |
- (void)didReceiveMemoryWarning | |
{ | |
[super didReceiveMemoryWarning]; | |
} | |
#pragma mark - View lifecycle | |
/* We are ready to load a page using our new webview functionality */ | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self loadPageFromFile:@"index.html"]; | |
//[self loadPageWithURL:@"http://www.google.ca"]; | |
} | |
- (void)viewDidUnload | |
{ | |
[super viewDidUnload]; | |
} | |
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | |
{ | |
// Return YES for supported orientations | |
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | |
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); | |
} else { | |
return YES; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment