Skip to content

Method that position multiple edges now accept an `offset` parameter

Compare
Choose a tag to compare
@lucdion lucdion released this 06 Aug 11:04
· 364 commits to master since this release

Method that position multiple edges now accept an offset parameter that specifies the distance from their superview's corresponding edges in pixels.

New methods:

  • topLeft(_ offset: CGFloat)

  • topCenter(_ topOffset: CGFloat)

  • topRight(_ offset: CGFloat)

  • centerLeft(_ leftOffset: CGFloat)

  • center(_ offset: CGFloat)

  • centerRight(_ rightOffset offset: CGFloat)

  • bottomLeft(_ offset: CGFloat)

  • bottomCenter(_ bottomOffset: CGFloat)

  • bottomRight(_ offset: CGFloat)

For example, to position a view at the top left corner with a top and left margin of 10 pixels:

   view.pin.topLeft(10)

Other change

Cleanup the interface by using default value parameters.