Created
February 25, 2013 14:27
-
-
Save lamprosg/5030141 to your computer and use it in GitHub Desktop.
(iOS) UIWebView
This file contains hidden or 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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| // Override point for customization after application launch. | |
| /*****************************************************************************************/ | |
| //intialize the root controller, with the the SwitchView nib. | |
| self.webViewController = [[BIDWebViewController alloc] initWithNibName:@"Web" bundle:nil]; | |
| //Make switchViewController the root controller | |
| self.window.rootViewController = self.webViewController; | |
| /*****************************************************************************************/ | |
| self.window.backgroundColor = [UIColor whiteColor]; | |
| [self.window makeKeyAndVisible]; | |
| return YES; | |
| } |
This file contains hidden or 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
| @interface BIDWebViewController : UIViewController | |
| @property (nonatomic, retain) IBOutlet UIWebView *webView; | |
| @end |
This file contains hidden or 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
| @implementation BIDWebViewController | |
| -(void)viewDidLoad | |
| { | |
| NSString *urlAddress = @”http://www.google.com”; | |
| //Create a URL object. | |
| NSURL *url = [NSURL URLWithString:urlAddress]; | |
| //URL Requst Object | |
| NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; | |
| //Load the request in the UIWebView. | |
| [webView loadRequest:requestObj]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment