Iphone app webview link action

Is there a way to do the link click action in the html UIWebView to load another UIView and pass the url value to this view instead of loading this html page into the same UIWebView. Basically, change the default action by clicking the link in the UIWebView. Is it possible?

+4
source share
2 answers

In the UIWebViewDelegate do the following:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ( navigationType == UIWebViewNavigationTypeLinkClicked ) { // do something with [request URL] return NO; } return YES; } 
+6
source

Source: https://habr.com/ru/post/1315263/


All Articles