我有分類的UIWebView,以便我可以獲得觸摸事件並且還實現了這個方便的方法。我很好奇,如果這可以在實際的iOS設備上工作。我不在辦公室,所以我不知道是否。它似乎在模擬器中工作。tapAtPoint在UIWebView子類
- (void) tapAtPoint:(CGPoint)point
{
id /*UIWebBrowserView*/ webBrowserView = nil;
id webViewInternal = nil;
object_getInstanceVariable(self, "_internal", (void **)&webViewInternal);
object_getInstanceVariable(webViewInternal, "browserView", (void **)&webBrowserView);
if (webBrowserView) {
[webBrowserView tapInteractionWithLocation:point];
}
}
有沒有人試過類似的東西?我肯定早上發現,哈哈。
是不是' 「_internal」'無證?它會得到Apple的批准嗎? –