Skip to content

Instantly share code, notes, and snippets.

@lamprosg
Created February 25, 2013 14:27
Show Gist options
  • Select an option

  • Save lamprosg/5030141 to your computer and use it in GitHub Desktop.

Select an option

Save lamprosg/5030141 to your computer and use it in GitHub Desktop.
(iOS) UIWebView
- (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;
}
@interface BIDWebViewController : UIViewController
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@end
@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