Skip to content

Method that position multiple edges now accept an "offset" parameter - #163

Merged
lucdion merged 5 commits into
masterfrom
add_anchors_margins
Aug 6, 2018
Merged

lucdion merged 5 commits into
masterfrom
add_anchors_margins

Conversation

@lucdion

@lucdion lucdion commented Aug 5, 2018

Copy link
Copy Markdown
Member

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

  • 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)

Previously, the required line was:

  view.pin.topLeft().margin(10)

Plus:

  • Cleanup the interface by using default value parameters.

@lucdion lucdion changed the title Method that position multiple edges now accept an "offset" parameter Method that position multiple edges now accept an "offset" parameter (e.g: topLeft(_ offset: CGFloat)) Aug 5, 2018
@lucdion lucdion changed the title Method that position multiple edges now accept an "offset" parameter (e.g: topLeft(_ offset: CGFloat)) Method that position multiple edges now accept an "offset" parameter Aug 5, 2018
@lucdion
lucdion merged commit 41005c4 into master Aug 6, 2018
@lucdion
lucdion deleted the add_anchors_margins branch August 6, 2018 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant