title: Button background Image in swift 3
body: <p>I add <em>background image</em> to button in swift. The actual image size is <strong>100x100</strong>. The idea is that when I click on the image, the popup of change profile image will appear. Then, you can choose photos from gallery and save. <br>
  After saving the photo, image shows fully. But, the problem is before I choose the photo from gallery, I set default image. Please see in following screenshot image.<br></p>
  
  <p><a href="https://i.stack.imgur.com/X1zHD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X1zHD.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Profile Female image should be big as background green color.</strong> Here is my code. <br></p>
  
  <pre><code>let img = UIImage(data: match.value(forKey: "imageData") as! Data )
  btnProfile.frame = CGRect(x: 10, y: 100, width: 100, height: 100)
  btnProfile.imageView?.contentMode = UIViewContentMode.scaleToFill
  btnProfile.setImage(img, for: UIControlState.normal)
  
  if(user_gender == "Female"){
  
        btnProfile.setImage(UIImage(named: "femaleprofile_image")?.withRenderingMode(.alwaysOriginal), for: .normal)
        btnProfile.imageView?.contentMode = UIViewContentMode.scaleToFill
  }
  </code></pre>
  
  <p>Image size is <strong>1@-> 40x40</strong> px and <strong>2@-> 80x80</strong>px.<br>
  Please anyone help me how to solve this problem.</p>