I have UIView touched event handler that perfomsSelector withDelay….But when the user untouch the screen the the touchEnded event is firing as should of course. i do this because I want the operations to start after the user puts and leaves the finger for couple of seconds in this UIView.
I would like when the user takes finger off the screen before the selector method starts (before the delay passes) first not to run the selector, and second not run the touchEnded method.
I could start adding flags, but this isn’t look efficient to me.
Is there another way to do this.
Thank you.
@rob answer is a better solution but if you can not use it from any reason. Try this:
in touches ended call cancelPreviousPerformRequestsWithTarget. that will cancel your previous call.