Transformation of vision using iPad Air (with retina display)

If I apply a transform to a view, then the movement of the view on the iPad Air is delayed. It looks like an implicit animation in CALayer. I created a test project . It must be performed on an iPad simulator. This is the code I use to apply the transforms:

CGAffineTransform transform = CGAffineTransformIdentity;
if (_transformSwitch.on)
{
    transform = CGAffineTransformRotate(CGAffineTransformMakeScale(2.0, 2.0), M_PI / 3.0);
}

self.frameView.transform = transform;

This is the code I use to move the move:

CGPoint transition = [_panRecognizer translationInView:self.view];
CGPoint newCenter = CGPointMake(_startCenter.x + transition.x, _startCenter.y + transition.y);
self.frameView.center = newCenter;

How can I move a view using applied transforms and avoid animation?

UPD I found a solution for moving around the timer call, but if I move the frame with my finger, I have problems with the animation. I set the view center by wrapping it with [CATransaction begin] [CATransaction commit]:

[CATransaction begin];
[CATransaction setValue:@(YES) forKey:kCATransactionDisableActions];

_destinationIndicatorView.center = center;
self.frameView.center = center;

[CATransaction commit];

, , ? setNeedsDisplay, . ( - drawRect setNeedsDisplay , ):

[CATransaction begin];
[CATransaction setValue:@(YES) forKey:kCATransactionDisableActions];

_destinationIndicatorView.center = center;
[self.frameView setNeedsDisplay];

self.frameView.center = center;

[CATransaction commit];

.

UPD2 iPad (, iPad Air). , : https://yadi.sk/i/rAneCEFmjjEej

+4
2

, :

[CATransaction begin];
[CATransaction disableActions];

// Your changes to the UI elements...

[CATransaction commit];
0

, 2 , , :

- drawRect: FrameView:

- (void)drawRect:(CGRect)rect
{
    [super drawRect:rect];
}

Apple:

. , Core Graphics UIKit, . , . , , , view , .

( , . ) - (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event FrameView: nil ( CALayerDelegate), CoreAnimation, , NSNull ( CALayer). , . this this.

P.S. CATransaction. , iPad , , , GitHub ( , ), , ( ) , ( iPad).

0

All Articles