Pregunta

¿Hay alguna forma de capturar clics en enlaces dentro de un UIWebView? Quiero averiguar la dirección en la que ha hecho clic el usuario, pero en realidad no ir a la página.

¿Es esto posible?

¿Fue útil?

Solución

Sí, hay un método de delegado que puede implementar el controlador de vista:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

referencia:

http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithStartLoadWithStartLoadWithStartLoadWithSquest navigationType :

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top