0

I have a simple synthesizer application that has 28 buttons (UIView's), and each one has a UILongPressGestureRecognizer attached to it. The .minimumPressDuration for each recognizer is set to 0, so that simply touching a button will begin it's UILongPressGestureRecognizer and start an AudioKit Oscillator.

All works fine until more than five buttons (recognizers) are touched (enabled) at one time. The sixth recognizer is never enabled, and the first five recognizers stay enabled, even when the user's finger lifts from any or all of the buttons.

It's an unfortunate problem, given that I would like the user to be able to play more than five notes at a time.

Any ideas?

I have attached UILongPressRecognizers to buttons that do not start an AudioKit Oscillator, but instead temporarily change the color of another view, but the problem persists.

I have also tried touching other areas of the screen that do not have UIGestureRecognizers attached to them, and even those touches seem to cause the problem.

1 Answers1

0

There is an undocumented 5 touch limit on iPhone. The number is higher for iPad but I'm not sure what that limit is (greater than 10).

Nick C.
  • 226
  • 1
  • 4
  • Do you know if there is a way to simply ignore the extra touches so the gesture recognizers do not get affected? – Evan Escobar Oct 27 '22 at 19:56
  • 1
    On iPhone, all touches are cancelled after the 6th touch and additional touches aren't registered either. – Nick C. Oct 31 '22 at 16:09
  • That explains why all of the oscillators remain on and the gesture recognizers never reach the “.ended” state. Thanks! – Evan Escobar Oct 31 '22 at 17:50