title: Dynamic type for UIButton's attributeTitle
body: <p>Anyone ever got dynamic type working for <code>attributedTitle</code> on <code>UIButton</code>? Consider the super simple code below:</p>
  
  <pre><code>let font = UIFont(name: "Helvetica", size: 14)!
  let scaledFont = UIFontMetrics.default.scaledFont(for: font)
  
  let button = UIButton(type: .custom)
  button.titleLabel?.font = scaledFont
  button.titleLabel?.adjustsFontForContentSizeCategory = true
  
  let attributes: [NSAttributedString.Key: Any] = [ .font: scaledFont ]
  let attributedText = NSAttributedString(string: "Press me", attributes: attributes)
  button.setAttributedTitle(attributedText, for: .normal)
  </code></pre>
  
  <p>If I scale the font size up and down using Accessibility Inspector, the button's size and label text doesn’t scale properly. </p>
  
  <p>If I just call <code>button.setTitle()</code> passing an ordinary string, though, dynamic type scaling works fine.</p>
  
  <p>Using the same pattern for attributed text directly on a <code>UILabel</code> works fine… it just seems to be when I use attributed text for a <code>UIButton</code>’s title.</p>
  
  <p>Any thoughts or suggestions would be awesome. Thanks</p>
  
  <p><strong>Edit:</strong> After a bit more poking, it looks like what is happening is that the text is trying to scale, but the button's width/height aren't growing with it. If I dial up dynamic type to the largest text size and then create the screen and proceed to shrink the font size, it works OK because the buttons width/height constraints are set to an initially large value. But if I start with a small dynamic type setting and grow larger, the button doesn't accommodate the text size change</p>