RectBasedConstraint

public protocol RectBasedConstraint

Main protocol for any layout constraint

  • Main function for constrain source space by other rect

    Declaration

    Swift

    func formConstrain(sourceRect: inout CGRect, by rect: CGRect)

    Parameters

    sourceRect

    Source space

    rect

    Rect for constrain

RectBasedConstraint

  • constrained(sourceRect:by:) Extension method

    Wrapper for main constrain function. This is used for working with immutable values.

    Declaration

    Swift

    public func constrained(sourceRect: CGRect, by rect: CGRect) -> CGRect

    Parameters

    sourceRect

    Source space

    rect

    Rect for constrain

    Return Value

    Constrained source rect

Available where Self: Extensible, Self.Conformed == RectBasedConstraint