Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"The UIWebView class should not be subclassed." - from <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html" rel="nofollow noreferrer">Apple's <code>UIWebView</code> docs</a>.</p> <p>It sounds like you're trying to mess with how a person interacts with a web page, which is likely to get you rejected from the app store. (For a lot of possible rejection reasons, check out <a href="http://www.apprejected.com/" rel="nofollow noreferrer">app rejected</a>.)</p> <p>If you're not worried about that, here is some advice that might help you achieve your goals:</p> <ul> <li>If you want to control where the user can and can't go via hyperlinks, or just perform some code whenever they click on some links, you can add a hook via the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest:navigationType:" rel="nofollow noreferrer"><code>webView:shouldStartLoadWithRequest:navigationType:</code></a> method of the <code>UIWebViewDelegate</code> protocol. Very handy.</li> <li>If you want to perform some simple modifications to how the page acts or looks, you can essentially execute your own javascript in the page with a call to <code>stringByEvaluatingJavaScriptFromString:</code>, a method of <code>UIWebView</code> itself. Just pass in your javascript as a string.</li> </ul> <p>And, in case that doesn't give you want you want (in which case you're really going to tick off them app store review guys), then you can probably do what you're already doing, and just propagate all those <code>UITouch</code>s right on through to the <code>UIWebView</code> itself. Something like this, as an example (in the overlapping <code>UIView</code>):</p> <pre><code>- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [self doWhatever]; [underlappingWebView touchesMoved:touches withEvent:event]; } </code></pre> <p>That way you can have your cake (get the user touch info) and eat it too (have the web page act as it normally does).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload