On 22 Apr 2010, at 8:18 AM, Dylan Copeland wrote:

> I have a UIView subclass that overrides UIResponder's touchesMoved: message. 
> I've noticed that when I swipe my finger very quickly across the UIView, my 
> touchesMoved: message only gets called every so often and not constantly 
> getting messaged.

You are, of course, apologetic about posting an entire digest to the list. 
Remember to keep up the subject line.

What user-visible behavior are you trying to produce? "Every so often" seems to 
mean not often enough for you, but it would help to know, "not often enough for 
what?" Are you expecting to be notified of every pixel's worth of movement, no 
matter how little time comes between?

Back-of-the-envelope math: A fast swipe across the face of an iPhone may take 
1/10 of a second, or 3200 pixels per second, or 312.5 microseconds per pixel. I 
suppose the screen refreshes 60 times a second, or every 16700 µs, which means 
the pixel movements are piling up 53 times faster than anything you can do to 
represent them on screen (even granting that your code can do any worthwhile 
graphical work in its share of 312 µs).

So somebody — you or the OS — has to aggregate touch movements. You can't 
always get the smallest quantum of movement, so strictly speaking, "every so 
often" is all you can expect. The question then is: Is that often enough? And 
for what?

I've heard people raising this sort of question about drawing programs. They 
had hoped to be notified of every pixel, so all they'd have to do is blit the 
brush tip onto the screen at each event. Can't do it; even desktop mouse 
movements get aggregated. If they wanted to do it, they had to calculate the 
straight line between the reported positions, and draw the brush tip at every 
pixel.

        — F

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to