Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)
Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)
- Subject: Re: Third time I ask - please help. How to trace visible change in a UIView (UIWebView)
- From: Motti Shneor <email@hidden>
- Date: Mon, 22 Apr 2013 16:04:28 +0300
Thanks Marco,
Actually, we use the UIWebView not to display HTML contents, but because it so easily provide multi-document-format display.
We will probably use it most for displaying PDF documents, Image files, Word documents, etc. Anyway, it will display a single, static, local document (not from the net). The user will "share" a document, and the document will be both displayed, and "shared" to other people through the server.
Moreover, I doubt the efficiency of comparing HTML contents vs. comparing images, where I can very easily use the GPU to subtract pixel from pixel, then scan for non-zero data.
To be very precise --- I'd like to know how to be notified about ANY UIView visual change. It somehow seems very obvious to me that such "delegate call" must exist. Maybe I'm overlooking something very basic here.
Was it MY view, I'd "ride" the drawRect: I think. but again, I'm not sure on iOS, if you pinch a view to zoom-out, whether drawRect is called or not.
Thanks again!.
On 22 באפר 2013, at 15:29, Marco Tabini <email@hidden> wrote:
> On 2013-04-22, at 3:26 AM, Motti Shneor <email@hidden> wrote:
>
>> Hello everyone. I asked this several times before, but no one gave any hint -- I'd like to know if anyone here has any clue, at least where to search for an answer.
>>
>> I need to observe the visible contents of a UIWebView dIsplayed in my iOS application. Each time the visible contents changes, I need to capture the contents as image, and transmit it to our server. A bit like screen-sharing on the Mac, but not for the whole screen contents, just a single view.
>
> If your UIWebView is displaying an HTML document, you could potentially inject some Javascript to watch for DOM changes on the <html> tag (Google “WebKitMutationObserver”); when a change is detected, your Javascript can force-load a URL with a custom scheme, which you can then trap inside your Objective-C code, where you can capture the view's state.
>
> There are other ways to achieve this, but this is the only one I can think of that might (a) capture all changes and (b) be in line with Apple's review guidelines. Note, however, that I haven't tried it, so it might not work at all for a number of reasons :-)
>
>
> —Mt.
>
Motti Shneor
----------------------------------------
Ceterum censeo Microsoftinem delendam esse
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden