开发者

How can I over-ride the UITextView link detection?

开发者 https://www.devze.com 2023-03-21 21:23 出处:网络
I have a UITextView that is auto-detecting link URL\'s. Instead of opening it in Safari, I want to present my own modal view controller that contains a webview so my开发者_Python百科 users stay in-app

I have a UITextView that is auto-detecting link URL's. Instead of opening it in Safari, I want to present my own modal view controller that contains a webview so my开发者_Python百科 users stay in-app.

How can I achieve this?


I don't think you can.

Where a UIWebView will tell its delegate when a link is tapped, a UITextView doesn't provide that kind of info.

You could use a UIWebView instead of a UITextView, but that's a workaround...


By all accounts this is possible with the following:

- (void)webView:(id)fp8 decidePolicyForNavigationAction:(id)fp12 request:(id)fp16 frame:(id)fp20 decisionListener:(id)fp24;

Credit goes to Muthu.chidambar here http://forums.macrumors.com/showthread.php?t=745879 (if it works that is ;-) )

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号