Ios 调用shouldStartLoadWithRequest中的视图控制器
我有两个带有UIWebView场景的视图控制器。主视图控制器(称为MainViewController)应调用第二个视图控制器(称为ViewController),并在用户点击带有PostPicPopUp的链接时显示该场景。 在MainViewController中,我有:Ios 调用shouldStartLoadWithRequest中的视图控制器,ios,uiwebview,Ios,Uiwebview,我有两个带有UIWebView场景的视图控制器。主视图控制器(称为MainViewController)应调用第二个视图控制器(称为ViewController),并在用户点击带有PostPicPopUp的链接时显示该场景。 在MainViewController中,我有: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebVie
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *urL=request.URL;
NSString *urlStr=[urL absoluteString];
//NSLog(@"URLL %@",urlStr);
if ([urlStr rangeOfString:@"PostPicPopUp"].location == NSNotFound) {
return YES;
} else {
return NO;
}
}
所以我需要你的密码
return YES
您可以使用以下代码手动调用视图控制器:
// Objective-C
ViewController *controller = [[ViewController alloc] init];
[self controller animated:YES completion:nil];
// Using storyboard
ViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewControllerIdentifier"];
[self presentViewController:controller animated:YES completion:nil];