This problem is caused by large block animations. I made a solution based on NSTimer, as suggested above, and it worked ... but the movement was jerky (unless I inserted an animation into each trigger of the timer event).
So, since animation was required anyway, I found a solution that does not require a timer. It enlivens only a small distance, and thus the button press is still accurate, and only a small error, which is my case, is very invisible in the user interface and can be reduced depending on your settings.
Note below that the error at any time is <15.0, which can be reduced for greater accuracy depending on the requirements of the animation speed. You can also shorten duration times for greater speed.
- (void)conveyComplete:(UIView*)v { [self convey:v delay:0]; } - (void)convey:(UIView*)v delay:(int)nDelay { [UIView animateWithDuration:.5 delay:nDelay options:(UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction) animations: ^ { CGRect rPos = v.frame; rPos.origin.x -= 15.0; v.frame = rPos; } completion: ^(BOOL finished) { [self conveyComplete:v]; }]; }
paiego
source share