title: imageView in iOS 11 using Swift
body: <p>I created 2 customs buttons in my navigation Controller. I have one left button and one right, and both have some text + an arrow icon. Since I updated to iOS 11, the size of icons has changed and I don't know why.</p>
  
  <p>This this the difference between iOS 10 (Left) and iOS 11 (right):</p>
  
  <p><a href="https://i.stack.imgur.com/tRAlK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tRAlK.png" alt="enter image description here"></a></p>
  
  <p>How can I change that?</p>
  
  <p>This is a piece of my code:</p>
  
  <pre><code>func addRightButton(){
    rightButton = UIButton.init(type: .custom)
    rightButton.setImage(UIImage(named: "back"), for: .normal)
    rightButton.imageView?.contentMode = .scaleAspectFit
  
    let width = UIScreen.main.bounds.size.width
    if width &lt; 375 {
       rightButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: UIFont.Weight.bold)
       rightButton.frame = CGRect.init(x: 0, y: 0, width: 75, height: 10)
    } else {
       rightButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: UIFont.Weight.bold)
       rightButton.frame = CGRect.init(x: 0, y: 0, width: 100, height: 10)
    }
  
    rightButton.imageView!.transform = rightButton.imageView!.transform.rotated(by: CGFloat((Double.pi / 2) * -1))
    rightButton.setTitle(" Mixte",for: .normal)
    rightButton.addTarget(self, action: #selector(self.switchSex(_:)), for: UIControlEvents.touchUpInside)
  
    let barButton = UIBarButtonItem(customView: rightButton)
    self.navigationItem.rightBarButtonItem = barButton
  }
  </code></pre>