PinLayout v1.8.3 Release Notes

Release Date: 2018-08-28 // over 5 years ago
  • โž• Add methods to layout a view between two other views

    โž• Add methods to position a view between two other views, either horizontally or vertically.

    ๐Ÿ†• New Methods:

    horizontallyBetween(:UIView, and: UIView)
    Position the view between the two specified views horizontally. The method layout the view's left and right edges. The order of the reference views is irrelevant.
    Note that the layout will be applied only if there is horizontal space between the specified views.

    horizontallyBetween(:UIView, and: UIView, aligned: VerticalAlign)
    Position the view between the two specified views horizontally and aligned it using the specified VerticalAlign. The view will be aligned related to the first specified reference view. Note that the layout will be applied only if there is horizontal space between the specified views.

    verticallyBetween(:UIView, and: UIView)
    Position the view between the two specified views vertically. The method layout the view's top and bottom edges. The order of the reference views is irrelevant. Note that the layout will be applied only if there is vertical space between the specified views.

    verticallyBetween(:UIView, and: UIView, aligned: HorizontalAlign)
    Position the view between the two specified views vertically and aligned it using the specified HorizontalAlign. The view will be aligned related to the first specified reference view. Note that the layout will be applied only if there is vertical space between the specified views.

    Example:

    ๐Ÿ“„

     view.pin.verticallyBetween(viewA, and: viewB, aligned: .center).marginVertical(10)
    

    ๐Ÿ‘€ See Readme for more information