Skip to content

Update hCenter(CGFloat), hCenter(percent), vCenter(CGFloat), vCenter(percent)

Compare
Choose a tag to compare
@lucdion lucdion released this 22 Sep 11:21
· 667 commits to master since this release

Breaking change related to hCenter(CGFloat), hCenter(percent), vCenter(CGFloat), vCenter(percent):

  • vCenter(_ value: CGFloat) and vCenter(_ percent: Percent):
    The value specifies the distance vertically of the view's center related to the superview's center in pixels. Previously it was related to the superview's top edge.
  • hCenter(_ value: CGFloat) and hCenter(_ percent: Percent):
    The value specifies the distance horizontally of the view's center related to the superview's center in pixels. Previously it was related to the superview's left edge.

Previously hCenter(0) wasn't equal to hCenter(), same thing for vCenter(0). But this was an exception: top(0) == top(), left(0) == left(), right(0) == right(). Now thay all have the same logic.