I have been developing an HTML5
/ Javascript
webapp for the iOS
platform. I am relatively new to Objective and XCode, but I know my way around the program. I am attempting to have the UIWebView open a form, once submitted (submit button) in Safari as opposed to opening it in the current UIWebView.
The code below is suggested for opening standard <a>
tags in Safari:
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
if ( inType == UIWebViewNavigationTypeLinkClicked ) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}
( original post here )
I have tried adapting this code specifically for submitted forms like so:
- (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)inType {
if ( inType == UIWebViewNavigationTypeFormSubmitted ) {
[[UIApplication sharedApplication] openURL:[request URL]];
return YES;
}
if ( inType == UIWebViewNavigationTypeFormResubmitted ) {
[[UIApplication sharedApplication] openURL:[request URL]];
return YES;
}
return YES;
}
And FYI I have switched the return values of each IF statement to YES / NO, however this doesn't seem to be the issue... Any thoughts? Code? Theory? Thank You!