LayoutConstraintProtocol
public protocol LayoutConstraintProtocol : RectBasedConstraint
Provides rect for constrain source space. Used for related constraints.
-
Flag, defines that constraint may be used for layout
Declaration
Swift
var isActive: Bool { get } -
Flag that constraint not required other calculations. It`s true for size-based constraints.
Declaration
Swift
var isIndependent: Bool { get } -
LayoutElementobject associated with this constraintDeclaration
Swift
func layoutElement(is object: AnyObject) -> Bool -
Return rectangle for constrain source rect
Declaration
Swift
func constrainRect(for currentSpace: CGRect, in coordinateSpace: LayoutElement) -> CGRectParameters
currentSpaceSource rect in current state
coordinateSpaceWorking coordinate space
Return Value
Rect for constrain
-
Converts rect from constraint coordinate space to destination coordinate space if needed.
Declaration
Swift
func convert(rectIfNeeded rect: CGRect, to coordinateSpace: LayoutElement) -> CGRectParameters
rectInitial rect
coordinateSpaceDestination coordinate space
Return Value
Converted rect
-
active(_:)Extension methodReturns constraint with possibility to change active state
Declaration
Swift
func active(_ active: Bool) -> MutableLayoutConstraintParameters
activeInitial active state
Return Value
Mutable layout constraint
LayoutConstraintProtocol Protocol Reference