UIStackView's own intrinsicContentSize
As of iOS 9.1, UIStackView
doesn't implement intrinsicContentSize
:
import UIKit
import ObjectiveC
let stackViewMethod = class_getInstanceMethod(UIStackView.self, "intrinsicContentSize")
let viewMethod = class_getInstanceMethod(UIView.self, "intrinsicContentSize")
print(stackViewMethod == viewMethod)
Output:
true
You could make a subclass of UIStackView
and implement it yourself if you really need it. You shouldn't need to, though. If UIStackView
is allowed (by the constraints on it) to choose its own size, it does so based on its arranged subviews' intrinsic content size (or by other constraints you've set on the sizes of its arranged subviews).