Reputation: 27485
I want to switch between a couple views with a flick gesture using two fingers. If anyone can tell me what I need to do please help.
Upvotes: 2
Views: 1643
Reputation: 3812
Without actually writing the code for you, here's what you'll need to do to track a multi-finger swipe:
multipleTouchEnabled
property to YES so that you'll be able to track multiple touches.touchesBegan
, store the each touches' locationInView
property (this is a CGPoint
).touchesMoved
, compare the current location of the touches with the stored starting locations from step 2. If they're still in the "swipe window," do nothing. If one or both of the fingers has moved outside of its "swipe window," then cancel the swipe checking. If they've both met the requirements for a swipe, fire whatever method you want to have called when you've detected a multi-finger swipe.Hope this helps.
Upvotes: 4