title: How to set image for bar button with swift?
body: <p>I am trying to set an Image for bar button Item for that I have an image like:</p>
  
  <p><img src="https://i.stack.imgur.com/WDODD.png" alt="enter image description here"></p>
  
  <p>with resolution 30 * 30 but while I assign this Image to Bar button Its looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/0UAHf.png" alt="enter image description here"></p>
  
  <p>I have assigned image this way :</p>
  
  <p><img src="https://i.stack.imgur.com/omDWS.png" alt="enter image description here"></p>
  
  <p>and If I try this way like making an IBOutlet for the button and set Image programatically form <a href="https://stackoverflow.com/questions/24769770/swift-setting-back-button-image-in-nav-bar">this</a> question and code for that is:</p>
  
  <pre><code> // Outlet for bar button
   @IBOutlet weak var fbButton: UIBarButtonItem!
  
  // Set Image for bar button
  var backImg: UIImage = UIImage(named: "fb.png")!
  fbButton.setBackgroundImage(backImg, forState: .Normal, barMetrics: .Default)
  </code></pre>
  
  <p>but nothing happend with this,</p>
  
  <p>Can anybody tell me what I am doing wrong?</p>
  
  <p>or which is the batter way to do this?</p>