NSLayoutConstraint
class NSLayoutConstraint : NSObject
-
Construct instance of NSLayoutConstraint with priority set
See UIKit NSLayoutConstraint for further details
Declaration
Swift
public convenience init(item: Any, attribute attr1: LayoutAttribute, relatedBy: LayoutRelation, toItem: Any?, attribute attr2: LayoutAttribute, multiplier: CGFloat, constant: CGFloat, priority: Constraid.LayoutPriority)
Parameters
item
The
item
you want to constrainattr1
The attribute of
item
to constrainrelatedBy
relation ship to use to constrain
item
‘sattr1
totoItem
’sattr2
toItem
The item you want to constrain
item
toattr2
The attribute of the
toItem
to constrainmutiplier
The ratio altering the constraint relative to toItem’s attr2 in the constraint equation
constant
The constant in the constraint equation
priority
The priority this constraint uses when being evaluated against other constraints
Return Value
the constructed NSLayoutConstraint