I have a label and image attached in a vertical stack view. I want them to be centered to the stack view, but not larger. I also want the top of the label to be aligned to the bottom of the image.
I tried those constraints:

But the label is stuck to the bottom of the stack view.
I also tried:
NSLayoutConstraint(item: stackView,
attribute: .top,
relatedBy: .greaterThanOrEqual,
toItem: contentView,
attribute: .top,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: stackView,
attribute: .bottom,
relatedBy: .greaterThanOrEqual,
toItem: contentView,
attribute: .bottom,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: stackView,
attribute: .left,
relatedBy: .greaterThanOrEqual,
toItem: contentView,
attribute: .left,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: stackView,
attribute: .right,
relatedBy: .greaterThanOrEqual,
toItem: contentView,
attribute: .right,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: stackView,
attribute: .centerX,
relatedBy: .equal,
toItem: contentView,
attribute: .centerX,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: stackView,
attribute: .centerY,
relatedBy: .equal,
toItem: contentView,
attribute: .centerY,
multiplier: 1,
constant: 0).isActive = true
NSLayoutConstraint(item: imageView,
attribute: .height,
relatedBy: .equal,
toItem: stackView,
attribute: .height,
multiplier: 0.5,
constant: 0).isActive = true
But now the image top is stuck to the top of the content view top, and the label bottom is stuck to the bottom of the content view bottom.