Can I pull on touch points right after touching Began: gets a call?

Simply put, you know that the iPhone OS makes an artificial delay of about 0.25 seconds after touchsBegan: happens. It is necessary to check whether the user intends to move or not. If the delta moves significantly enough during this time, the touchMoved: sequence begins.

But when you want to implement tactile touch behavior in your application, you may not need any delay. It looks so ugly! You start to move something, and nothing happens for 0.3 seconds. Then, BANG and it all starts to move with a big upheaval. This happens every time a new sensory sequence with movement begins. It sucks a lot. Of course, in some situations this is necessary because you can determine if the user really intended to move. but not so on a custom assembly slider or other kind of tactile control that works by tracking touch movements.

So, after I realized that this is happening intentionally with the iPhone OS, I would like to know how to overcome this problem. I cannot predict the movement because the user can move left or right. I do not know this in touch. 0.3 seconds is enough to make the application look immune.

However, there seems to be hope: Convertbot has absolutely no problem with this. The wheel rotates immediately after touching and moving. No lag, no delays. I asked on my blog how they did it, but there is no answer yet.

Hopefully there is a way to manually pull the coordinate system out of the system. When Began touches: I would start an interval that draws at 60 Hz until it touches movd: takes action.

So the biggest question on this planet is, “How is this possible?”

+7
performance iphone cocoa-touch uikit
source share
2 answers

If your respondents are in UIScrollView, make sure scrollView delayesContentTouches is set to NO. This will work for both the UIResponder touchBegan: method and the UIControl beginTrackingWithTouch :.

+4
source share

If your subclass of UIView is a subview of UITableView or one of its descendants, for example UITableView, you must delaysContentTouches to NO in scroll view or table view. This way it will immediately send the first message to your touchesBegain:

However, I think ConvertBot doesn't use UIScrollView at all: it's probably a custom UIView that implements the rotating element itself. If your user interface does not require scrolling, just put your UIView subclass in the content view and you do not need to set delaysContentTouches because there is no scrolling to catch touch events.

0
source share

All Articles