title: Added a drop down triangle to my UIButton with a subclass, how can I prevent it from stretching when I change the title?
body: <p>I have a simple <code>UIButton</code> subclass to add a drop down triangle to the default UIButtons. I drop a <code>UIView</code> in my view controller's title view in my Storyboard, and then add the button subclass to that view in Storyboard. The only thing I do with Auto Layout in the Storyboard is center it vertically and horizontally.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>class DropDownButton: UIButton {   
      override func awakeFromNib() {
          super.awakeFromNib()
  
          setImage(UIImage(named: "drop-down-triangle"), forState: .Normal)
  
          sizeToFit()
  
          titleEdgeInsets = UIEdgeInsets(top: 0, left: -imageRectForContentRect(bounds).width - 17.0, bottom: 0, right: 0)
          imageEdgeInsets = UIEdgeInsets(top: 0, left: titleRectForContentRect(bounds).width, bottom: -2, right: 0)
      }
  }
  </code></pre>
  
  <p>And here's what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/tOJJu.png" alt="enter image description here"></p>
  
  <p>In code I sometimes change the title with:</p>
  
  <pre><code>dropDownButton.setTitle(title, forState: .Normal)
  </code></pre>
  
  <p>Which causes it to look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/mPMZS.png" alt="enter image description here"></p>
  
  <p>What is causing this? How do I stop it from stretching?</p>