title: Content hugging priority not working with custom view and label in UIStackView
body: <p>I am having trouble getting content hugging working on a custom view. I have the following code:</p>
  <pre><code>pillView.setContentHuggingPriority(.required, for: .horizontal)
  pillView.setContentCompressionResistancePriority(.required, for: .horizontal)
  dateLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
  dateLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
  </code></pre>
  <p>I add these two views to a stack view:</p>
  <p><code>let dateStackView = UIStackView(arrangedSubviews: [pillView, dateLabel])</code></p>
  <p>The result is like so:</p>
  <p><a href="https://i.stack.imgur.com/jlb7P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jlb7P.png" alt="enter image description here" /></a></p>
  <p>The LIVE NOW view should hug it's content. It's defined like so:</p>
  <pre><code>final class PillView: UIView {
  
      private enum Constants {
          static let radius: CGFloat = 4.0
          static let labelInsets = UIEdgeInsets(horizontal: 8.0, vertical: 4.0)
      }
  
      enum Config {
          case attention
  
          var font: UIFont {
              switch self {
              case .attention: return Font.caption
              }
          }
          var textColor: UIColor {
              switch self {
              case .attention: return .white
              }
          }
          var backgroundColor: UIColor {
              switch self {
              case .attention: return Theme.red100
              }
          }
      }
  
      // MARK: - Properties
  
      private let config: Config
  
      // MARK: - Initializers
  
      init(text: String, config: Config = .attention) {
          self.config = config
          super.init(frame: .zero)
  
          backgroundColor = config.backgroundColor
          clipsToBounds = true
          layer.cornerRadius = Constants.radius
  
          let label = UILabel()
          label.font = config.font
          label.textColor = config.textColor
          label.text = text
  
          addSubview(label)
          label.translatesAutoresizingMaskIntoConstraints = false
          NSLayoutConstraint.activate([
            label.topAnchor.constraint(equalTo: topAnchor, constant: Constants.labelInsets.top),
            label.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Constants.labelInsets.bottom),
            label.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Constants.labelInsets.left),
            label.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Constants.labelInsets.right)
          ])
      }
  
      required init?(coder: NSCoder) {
          fatalError(&quot;init(coder:) has not been implemented&quot;)
      }
  
  }
  </code></pre>
  <p>Not sure why it won't hug the content when in a stack view. Any ideas? Would really appreciate some pointers on this. thanks!</p>