Link Search Menu Expand Document

LayoutConstraint

public class LayoutConstraint 

Initializers

init(item:attribute:relatedBy:toItem:attribute:multiplier:constant:)

Creates a constraint that defines the relationship between the specified attributes of the given views.

public /*convenience*/ init(item firstItem: AnyObject,
                              attribute firstAttribute: LayoutConstraint.Attribute,
                              relatedBy relation: LayoutConstraint.Relation,
                              toItem secondItem: AnyObject?,
                              attribute secondAttribute: LayoutConstraint.Attribute,
                              multiplier: Double, constant: Double) 

Properties

isActive

The active state of the constraint.

public var isActive: Bool = false 

firstItem

The first object participating in the constraint.

public unowned(unsafe) var firstItem: AnyObject? 

firstAttribute

The attribute of the first object participating in the constraint.

public var firstAttribute: LayoutConstraint.Attribute 

relation

The relationship between the two attributes in the constraint.

public private(set) var relation: LayoutConstraint.Relation

secondItem

The second object participating in the constraint.

public unowned(unsafe) var secondItem: AnyObject? 

secondAttribute

The attribute of the second object participating in the constraint.

public var secondAttribute: LayoutConstraint.Attribute 

multiplier

The multiplier applied to the second attribute participating in the constraint.

public private(set) var multiplier: Double

constant

The constant added to the multiplied second attribute participating in the constraint.

public private(set) var constant: Double

firstAnchor

The first anchor that defines the constraint.

public private(set) var firstAnchor: LayoutAnchor<AnyObject>

secondAnchor

The second anchor that defines the constraint.

public private(set) var secondAnchor: LayoutAnchor<AnyObject>?

priority

The priority of the constraint.

public var priority: LayoutPriority = .required

identifier

The name that identifies the constraint.

public var identifier: String?

Methods

activate(_:)

Activates each constraint in the specified array.

public class func activate(_ constraints: [LayoutConstraint]) 

deactivate(_:)

Deactivates each constraint in the specified array.

public class func deactivate(_ constraints: [LayoutConstraint])