CALayer's delegate prevents implicit animation?
CALayer's delegate prevents implicit animation?
- Subject: CALayer's delegate prevents implicit animation?
- From: Seth Willits <email@hidden>
- Date: Wed, 18 Dec 2013 10:51:41 -0800
Short version:
In 10.9 only: My CALayer's delegate doesn't implement **any** delegate methods, but because a delegate is set, the layer's position will not implicitly animate. If I don't set it, it works fine.
Longer version:
I have a view hosting a very plain root layer, and then this layer in question as a sublayer of that root layer.
rootLayer = [[CALayer alloc] init];
self.layer = rootLayer;
self.wantsLayer = YES;
rootLayer.frame / bounds / delegate = ...;
sublayer = [[CALayer alloc] init];
sublayer.frame / bounds = ...;
sublayer.delegate = self;
Later on I simply move it...
[CATransaction begin];
[CATransaction setAnimationDuration:1.0];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
sublayer.position = newPosition;
[CATransaction commit];
... and it's not animating. I have narrowed it down to the delegate being non-nil, even if the delegate implements none of the delegate methods. If I don't set it, it works fine. This was working fine for yeeeeeeears and now in 10.9 it's behaving differently.
What could possibly be happening?
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden