---
title: constant
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/nslayoutconstraint/constant
---

# constant

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

## Declaration

```swift
var constant: CGFloat { get set }
```

## Discussion

Discussion Unlike the other properties, the constant can be modified after constraint creation. Setting the constant on an existing constraint performs much better than removing the constraint and adding a new one that’s exactly like the old except that it has a different constant.

## See Also

### Accessing constraint data

- [firstItem](uikit/nslayoutconstraint/firstitem.md)
- [firstAttribute](uikit/nslayoutconstraint/firstattribute.md)
- [relation](uikit/nslayoutconstraint/relation-swift.property.md)
- [secondItem](uikit/nslayoutconstraint/seconditem.md)
- [secondAttribute](uikit/nslayoutconstraint/secondattribute.md)
- [multiplier](uikit/nslayoutconstraint/multiplier.md)
- [firstAnchor](uikit/nslayoutconstraint/firstanchor.md)
- [secondAnchor](uikit/nslayoutconstraint/secondanchor.md)
