What can the intrinsic content size provide that the Autolayout anchors can't

I'm having difficult time understanding the practical usage of the intrinsic content size, especially the cases when you have to override the existing intrinsic size. It seems like using the widthAnchor and the heightAnchor seem to resolve what the intrinsic content size is trying to solve.

Code Block swift
For example if I wanted a certain intrinsic size:
class CustomView: UIView {
override var intrinsicContentSize: CGSize {
return CGSize(width: 200, height: 100)
}
}

I could achieve the same effect by using the Autolayout  anchors:

Code Block swift
NSLayoutConstraint.activate([
view.heightAnchor.constraint(equalToConstant: 100),
view.widthAnchor.constraint(equalToConstant: 200)
])


When the stack view are required to have a size, you can also provide it with the anchors.

Only two use cases I found it to be helpful is if you wanted to manipulate the existing original intrinsicContentSize:

Code Block swift
class CustomView: UIView {
override var intrinsicContentSize: CGSize {
let originalSize = super.intrinsicContentSize
return CGSize(width: originalSize.width + 200, height: 100)
}
}


But, I feel like intrinsicContentSize offers far more than simply using it as margins.

The second use case is when you can change the priority by using either setContentCompressionResistancePriority(_:for:) or setContentHuggingPriority(_:for:) to indicate how to respond to the changes in its superview dynamically.

Seems you do understand the functionalities of intrinsicContentSize correctly.

It provides a way to define a little more flexible way to define margins dynamically.
Imagine your CustomView may change the size dynamically depending on its content. (Like UILabel.)
What can the intrinsic content size provide that the Autolayout anchors can't
 
 
Q