Skip to content

Instantly share code, notes, and snippets.

@AnuragMishra
Created June 29, 2012 00:32
Show Gist options
  • Save AnuragMishra/3014942 to your computer and use it in GitHub Desktop.
Save AnuragMishra/3014942 to your computer and use it in GitHub Desktop.
UIWebView black patch test
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"Me called");
return NO;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
UIWebView *webView = [[UIWebView alloc] initWithFrame:self.window.bounds];
webView.delegate = self;
NSURL *url = [NSURL URLWithString:@"http://www.google.com"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.window addSubview:webView];
[self.window makeKeyAndVisible];
[webView loadRequest:urlRequest];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment