title: Front Camera to Fill Circular UIView
body: <p>In an app I'm developing the user is required to take a "selfie" (Yes, I know, but the app is for private use only).</p>
  
  <p>I've got everything working with the camera showing in the circular UIView region, however I cannot get it to scale and fill the circle properly. Here's what it's doing now:</p>
  
  <p><img src="https://i.stack.imgur.com/kyBrC.png" alt="What it&#39;s doing"></p>
  
  <p>And here's what I want it to be doing:</p>
  
  <p><img src="https://i.stack.imgur.com/2QGbI.png" alt="What I want"></p>
  
  <p>Here's the code for my UIView:</p>
  
  <pre><code>var cameraView = UIView()
  cameraView.frame = CGRectMake(100, self.view.center.y-260, 568, 568)
  cameraView.backgroundColor = UIColor(red:26/255, green:188/255, blue:156/255, alpha:1)
  cameraView.layer.cornerRadius = 284
  cameraView.layer.borderColor = UIColor.whiteColor().CGColor
  cameraView.layer.borderWidth = 15
  cameraView.contentMode = UIViewContentMode.ScaleToFill
  cameraView.layer.masksToBounds = true
  </code></pre>
  
  <p>I have tried a few different contentMode options, include ScaleToFill, ScaleAspectFill, and ScaleAspectFit. They all generate the same exact result.</p>