I have an application that starts playing sound when the user touches the uiview and changes to different tones when the user slides a finger across the screen. The sound stops when the user lifts a finger.
I use touchsBegan, Moved, and Ended for this event.
My problem affects Ended (and / or canceled) sometimes it doesnβt work properly and the sound continues to play even after the finger is lifted from the screen.
So, as a workaround, I would like to implement a timer that will check the number of touches on the screen, and if it is zero, it will check and stop the audio player when playing.
I was looking for some code that could get me the number of touches like
UITouch * touches = [self getAllTouchesonScreen];
or something:)
source share