0

Is it possible to recognize gestures and touches simultaneously when interacting with a UIKit object. For example, when a user is scrolling through a slider or pickerview, could I also be handling a swipe gesture?

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
MyNameIsKo
  • 2,171
  • 1
  • 15
  • 24

2 Answers2

0

Use NSThread or NSTimer to create a new thread where you can create another process which will run parallel to main thread of the application

Mrunal
  • 13,982
  • 6
  • 52
  • 96
0

If you set your view controller to be the delegate of your gestures, you can implement:

- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer

I'm not sure if you're also trying to have the view handle touch events separately, but if you are, I'd recommend subclassing UIGestureRecognizer and handle touch events there.

Aaron Hayman
  • 8,492
  • 2
  • 36
  • 63
  • The object in question was a UIViewPicker. When handling the picker, ios does not categorize the interaction as a gesture recognizer so that method won't work. I think I would need to override the class of the object. – MyNameIsKo Jan 17 '12 at 15:02
  • I assume you mean UIPickerView and if what you say is true, then yes, I suppose you'd need to subclass it. But I'm surprised it doesn't work. UIPickerView is a fairly standard control and I can't see why they would handle touches directly in that view rather than the standard gesture recognizers. I've not had a problem with other UIKit views, including UIScrollView. – Aaron Hayman Jan 17 '12 at 16:34