Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISlider events not cancelled in iOS 8?

We're currently testing our apps (iOS 7 apps) that are in the store on an iOS 8 device. We noticed a big performance problem with UISliders.

If we pull the slider fast from left to right several times, the slider will not immediately go to our last position. It will perform every move we have done with our finger. It seems as if the intermediate touch events are not properly cancelled.

On iOS 7, the slider performance is fine.

Has anyone experienced the same problem? Is this a known problem? Is there a solution to this?

like image 600
user3436516 Avatar asked Aug 11 '14 18:08

user3436516


Video Answer


1 Answers

I'm running into the same problem with SmartGo Kifu; filed as rdar://18245085. Here's my current workaround: use a class derived from UISlider, and override continueTrackingWithTouch:withEvent: to filter out events that are coming in too fast.

- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
{
    if (self.tracking)
    {
        const NSTimeInterval TOO_FAST_TO_HANDLE = 0.1;
        if ([event timestamp] - previousTimestamp >= TOO_FAST_TO_HANDLE)
        {
            previousTimestamp = [event timestamp];
            return [super continueTrackingWithTouch:touch withEvent:event];
        }
    }
    return self.tracking;
}

Still hope this will get fixed for the final release of iOS 8, or somebody has a better way to handle this.

like image 157
smartgo Avatar answered Sep 30 '22 04:09

smartgo