init(attribute:relativeTo:attribute:offset:)
Creates and returns an CAConstraint object with the specified parameters.
Declaration
convenience init(attribute attr: CAConstraintAttribute, relativeTo srcId: String, attribute srcAttr: CAConstraintAttribute, offset c: CGFloat)Parameters
- attr:
The attribute of the layer for which to create a new constraint.
- srcId:
The name of the layer that this constraint is calculated relative to.
- srcAttr:
The attribute of
srcLayerthe constraint is calculated relative to. - c:
The offset added to the value of
srcAttr.
Return Value
A new CAConstraint object with the specified parameters. The scale of the constraint is set to 1.0.
Discussion
The value for the constraint is calculated as (srcAttr + offset).