facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

Is there a way to translate a view? #339

Closed supratik94 closed 7 years ago

supratik94 commented 7 years ago

The layers can be transtated easily using kPOPLayerTranslationY. Is there a way to do in on a view for the same? Mostly, applicable to subViews in UIViews

grp commented 7 years ago

Each UIView has an associated CALayer, accessible through the property layer. You can animate that backing layer and it will apply to the view as well.

If you just want to move the view rather than adjust the transform's translation, you can also use kPOPViewCenter.