material-motion-archive / coreanimation-swift

Archived February 16, 2017 :: Core animation plan types for Apple devices
Apache License 2.0
5 stars 2 forks source link

Performers shouldn't be flexible on their provided target type #20

Closed jverkoey closed 7 years ago

jverkoey commented 7 years ago

TweenPerformer allows Tweens to be registered to UIView and CALayer. In actuality, Tweens can only be added to CALayer.

This flexibility can cause problems due to how performers are instantiated. Consider the following example:

let tween = Tween(...)
runtime.addPlan(tween, view)
runtime.addPlan(tween, view.layer)

The tween will get added to view.layer twice, but through two different performers.

Our performers need to be more strict about what sorts of targets they accept. In this case our performers should only accept CALayer targets.

jverkoey commented 7 years ago

🎊 My diff is ready for review at http://codereview.cc/D1929