title: How to resize UIImageView programmatically in Swift?
body: <p>I am trying to resize programmatically a UIImageView based on the device screen size, but I can´t make it work. Nothing changes.</p>
  
  <p>Here´s my code:</p>
  
  <pre><code>    let screenSize: CGRect = UIScreen.mainScreen().bounds
  
      print(screenSize.height)
  
      imgLogo.image = AppKit.appLogo
  
      switch screenSize.height {
      case 736.0:
          print("iPhone 6 Plus")
          imgLogo.frame = CGRectMake(0,0, 80 ,80)
      case 667.0:
          print("iPhone 6")
          imgLogo.frame = CGRectMake(0,0, 60, 60)
      case 568.0:
          print("iPhone 5S")
          imgLogo.frame = CGRectMake(0,0, 50, 50)
      case 480.0:
          print("iPhone 4S")
          imgLogo.frame = CGRectMake(0,0, 40, 40)
      default: break
  </code></pre>
  
  <p>The View Mode in Interface Builder is set to "Aspect Fit". I am also using Auto Layout with no constraints to the UIImageView width and height.</p>
  
  <p>What´s the problem with this code?</p>