为什么 `NSLayoutConstraint.multiplier` 是只读的?

Why is `NSLayoutConstraint.multiplier` read-only?

这个决定背后的理由是什么,他们为什么要那样做?

为什么 constant 是可读写的,而 multiplier 不是?

Updating the constant of a constraint can be done very efficiently and fast. Changing its multiplier on the other hand is much more complicated on the inside and basically produces the same amount of work than removing and adding a constraint.

The API reflects this complexity so that developers are aware that this is a more expensive operation.

框架工程师 20 小时前发布https://developer.apple.com/forums/thread/655663