title: Circle Image View
body: <p>I am trying to make image view circled for profile pics.
  It was working properly before I had put constrains of UiScreen width.</p>
  
  <p>so here is the code</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
  @IBOutlet weak var imageView: UIImageView!
  
  @IBOutlet weak var proPicH: NSLayoutConstraint! //Profile Picture Height
  @IBOutlet weak var proPicW: NSLayoutConstraint! // Profile Picture Width
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
      circleImage()
  }
  
  func circleImage() {
      let screenSize = UIScreen.mainScreen().bounds
      let screenWidth = screenSize.width
      let width = screenWidth / 2
      print("ScreenWidth: \(screenWidth)")
      proPicW.constant = width
      proPicH.constant = width
  
      print("H:\(proPicH.constant)")
      print("W:\(proPicW.constant)") //Here the height and width comes to my expectations
  
      imageView.layer.cornerRadius = imageView.bounds.width / 2
      imageView.clipsToBounds = true
  
      print("Height: \(imageView.bounds.height)") // Here the height and width becomes more
  }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/yPlBk.jpg" alt="Here is how image comes, I want it to be round"></p>
  
  <p>Please help me with this to make image round</p>