Skip to content

Add `pinFrame` property to control differently how view's transform are handled

Choose a tag to compare

@lucdion lucdion released this 18 Feb 13:19
· 558 commits to master since this release

UIView.pin versus UIView.pinFrame

Until now UIView.pin was used to layout views, but there's also another property called UIView.pinFrame that does something slightly different in situations where the view has a transform (UIView.transform, scaling, rotation, ...).

  • pin: Set the position and the size of the non-transformed view. The size and position is applied before the transform. This is particularly useful when you want to animate a view using a transform without modifying its layout.

  • .pinFrame: Set the position and the size on the transformed view. The size and position is applied after the transform.

See https://github.com/mirego/PinLayout#uiviews-transforms for more informations.

Added by Luc Dion in Pull Request #122