对一CALayer 使用动画后,虽然动画结束,但相应的属性值并没有更新,,此时可以使用如下方法拿回一个当前的layer 的最新状态。
presentationLayer
Returns a copy of the layer containing all properties as they were at the start of the current transaction, with any active animations applied.
- (id)presentationLayer
Return Value
A layer instance representing the current presentation layer.
Discussion
This method provides a close approximation to the version of the layer that is currently being displayed. The sublayers, mask, and superlayer properties of the returned layer return the presentation versions of these properties. This pattern carries through
to the read-only layer methods. For example, sending a hitTest: message to the presentationLayer will query the presentation values of the layer tree.