title: Setting corner radius hides UIView
body: <p>I've created this extension to quickly add rounded corners to any <code>UIView</code>:</p>
  
  <pre><code>extension UIView {
      func setCorners(corners: UIRectCorner, radius: CGFloat) {
          print(self.frame) //-&gt; (359.0, 0.0, 306.0, 37.0)
          let maskPath = UIBezierPath(roundedRect: self.frame, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: 0.0))
          let maskLayer = CAShapeLayer()
          maskLayer.path = maskPath.cgPath
          self.layer.mask = maskLayer
          print(self.frame) //-&gt; (359.0, 0.0, 306.0, 37.0)
      }
  }
  </code></pre>
  
  <p>The code I use to create the view and round its corners:</p>
  
  <pre><code>let view = UIView(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: 100, height: 40))) //I reposition the view later
  view.setCorners(corners: [.bottomLeft, .bottomRight], radius: 8)
  </code></pre>
  
  <p>When commenting out the <code>setCorners(corners:radius:)</code>, the view appears, while it stays hidden otherwise.</p>
  
  <p>Any idea why this is happening?</p>