Touch Events
Hello, just wondering if there are certain variables or functions that return if the user has swiped his/her finger on the iPhone's screen. I read in the UITouch Reference:
I'm just looking for a specific function that will tell me if this has happened. If there isn't one, then is it all done manually? Thanks
Al
Quote:whether the finger is swiped (and if so, in which direction)
I'm just looking for a specific function that will tell me if this has happened. If there isn't one, then is it all done manually? Thanks
Al
You've got to handle swipes and pinches and what not yourself. The system only provides began/ended/cancelled/moved.
Hmm, I'll hopefully think of some way to implement that. Thanks again.
I'll see if this gets an answer on this thread beforee posting my own!
I'm trying to get multi-touch working. So far I have this...
Which works perfectly well, I can sure enough point and do stuff. When I touch my finger on the screen, I get the debug 'Touch Began' as expected. However, if I keep that finger down, then put another one down, then I dont see the debug again.
This leads me to believe that this function is only beign called once, when I would expect it to be called every time I put a new finger on the screen.
Or am I barking up totally the wrong tree with regards to multi touch?
I'm trying to get multi-touch working. So far I have this...
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint Point = [touch locationInView:self];
printf("Touch Began\n");
/*
Do stuff with point.x and point.y
*/
}Which works perfectly well, I can sure enough point and do stuff. When I touch my finger on the screen, I get the debug 'Touch Began' as expected. However, if I keep that finger down, then put another one down, then I dont see the debug again.
This leads me to believe that this function is only beign called once, when I would expect it to be called every time I put a new finger on the screen.
Or am I barking up totally the wrong tree with regards to multi touch?
By default, UIResponder subclasses (that is, anything that can respond to touchesBegan:withEvent: and company) have multi-touch disabled. You have to explicitly tell it that it can accept multitouch events. You can do this in a XIB file or in code.
Cheers,
How?
How?
Found it. It's
[self setMultipleTouchEnabled:YES];
for anyone who finds this thread in the future...
[self setMultipleTouchEnabled:YES];
for anyone who finds this thread in the future...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| pushing touch events to sdl | michelleC | 0 | 1,505 |
Mar 27, 2010 09:57 AM Last Post: michelleC |
|
| Model-View-Controller and touch events | Vinnie | 3 | 3,226 |
Jun 3, 2009 09:27 AM Last Post: AnotherJake |
|

