I managed to draw a rect :-) But I don't know how to draw a rounded rect.
Can someone help me out with the following code how to round the rect?
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);