When exactly do implicit animations take place in iOS?

后端 未结 6 1705
终归单人心
终归单人心 2020-12-02 17:39

Everyone and every book claims that there are implicit animations happening in CALayer. However, every time I wanted to verify that so far, I end up with a hard-snap to the

6条回答
  •  死守一世寂寞
    2020-12-02 17:55

    Keep in mind that sublayers of a UIView's primary layer do not normally have the UIView as their delegate. Therefore, they participate in implicit animation unless you explicitly block this, even if you haven't provided a delegate to return a nil action in response to actionForLayer:forKey:.

    So, one simple way to get implicit animation in a generic view is simply to add a sublayer that covers the primary layer.

    Matt Neuberg's book Programming iOS 5 (currently in beta on Safari Books Online) explains this topic very lucidly.

提交回复
热议问题