I have UIViewwhich is a superview UIImageViewand UILabel. UILabel may have a different size depending on the amount of text in it. Therefore, I need UIViewto grow and contract with UILabel, but cannot make it work.
Screenshot as it looks below:

As you can see, the distance between the label and above it is too great. In .xibI set the upper and lower limits on UILabeljust 10, but, apparently, they are somehow violated. UIViewhas an upper limit for the frame above with an image like >=10so that it can grow from 10.
You can see .xibbelow:

Content Hugging Priority UIView, . UILabel 4 : , , , UIView. Content Hugging Priority UILabel UIView, . UIImageView - UIView, .