title: How to draw a simple rounded rect in swift (rounded corners)
body: <p>I managed to draw a rect :-) But I don't know how to draw a rounded rect.</p>
  
  <p>Can someone help me out with the following code how to round the rect?</p>
  
  <pre><code>let canvas = UIGraphicsGetCurrentContext()
  rec = CGRectMake(0, 0, 40, 40);
  
  //var maskPath = UIBezierPath(roundedRect: rec, byRoundingCorners: .BottomLeft | .BottomRight, cornerRadii: CGSize(width: 3, height: 3))
  
  CGContextAddRect(canvas, rec);
  CGContextFillPath(canvas);
  </code></pre>