【发布时间】:2017-02-13 13:55:13
【问题描述】:
我有一个主 UIWebView,我正在尝试使用 SVWebViewController 打开任何 URL。我的代码如下所示。
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if (navigationType == UIWebViewNavigationTypeLinkClicked ) {
SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"];
[self presentViewController:webViewController animated:YES completion:NULL];
return NO;
}
return YES;
}
似乎 SVWebViewController 有一个 initWithAddress 参数。我想知道是否可以在该参数中传递请求的 URL。
提前谢谢你。
【问题讨论】:
标签: ios objective-c uiwebview