title: set an image/icon on button in Swift
body: <p>I am trying to achieve something like this: </p>
  
  <p><a href="https://i.stack.imgur.com/4BRhR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4BRhR.png" alt="enter image description here"></a></p>
  
  <p>So I want to add an image on the left of my button's title. </p>
  
  <p>I have found the following paragraph in documentation: </p>
  
  <p><a href="https://i.stack.imgur.com/i1eIo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i1eIo.png" alt="enter image description here"></a></p>
  
  <p>button.currentImage is read only property and I can not set it. 
  Who can tell how to implement it? </p>
  
  <p>I was trying to do it like this: </p>
  
  <pre><code>private let logoButton: UIButton = {
      let button = UIButton(type: .custom)
      button.setTitle("Logo", for: .normal)
      button.setImage(UIImage(named:"logo"), for: .normal)
      button.translatesAutoresizingMaskIntoConstraints = false
      button.addTarget(self, action: #selector(handleLogo), for: .touchUpInside)
      return button
  }()
  </code></pre>
  
  <p>But unfortunately I get picture stretched inside button and no title ... </p>
  
  <p>Am I missing something? Or should I try creating custom view with image + lable and make it clickable? thanks</p>