views:

55

answers:

2

How frequently touch events are supplied to the top-most application?

For instance, touch, drag finger around screen (for 1 second), release <- how many discrete samples do i get?

edit: What's the maximum? And will it be different for different generations of iPhone and different OS versions?

+2  A: 

You can profile this yourself by overriding the following UIResponder methods:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;

Save a date stamp when a touch begins, increment a static counter when a touch moves, save another time stamp one when a touch ends, and then do some simple division: rate = (# of touches)/(time interval)

Shaggy Frog
will it be different for different generations of iPhone and different OS versions?
Qubei
Will the rate be different? I don't know. I would *guess* yes, but the only way to know for sure is for you to run it yourself, on your own devices.
Shaggy Frog
That's bizarre. I would love to hear an explanation for the neg vote.
Shaggy Frog
A: 

Depends on the device and OS and what else is running. They are pretty much fired any chance they get. That is to provide apps with the most fluid and accurate movements possible.

Conceited Code