Basic shapes ● ◼ ▲ drawn in Swift with configurable properties.
Draw an oval
UIPrimitives.drawOval(width: 100, height: 100, fillColor: UIColor.redColor(), strokeSize: 12, strokeColor: UIColor.greenColor(), rotation: 20)
Draw a rectangle
UIPrimitives.drawRectangle(width: 100, height: 100, cornerRadius: 10, fillColor: UIColor.redColor(), strokeSize: 12, strokeColor: UIColor.greenColor(), rotation: 50)
Draw a triangle
UIPrimitives.drawTriangle(width: 100, height: 100, fillColor: UIColor.redColor(), strokeSize: 1, strokeColor: UIColor.greenColor(), rotation: 10)
*only width and height parameters are required to draw the shapes - default values for the other parameters are implied.
Default parameter values:
cornerRadiushas the default value of0fillColorhas the default value ofUIColor.redColor()strokeSizehas the default value of0strokeColorhas the default value ofUIColor.clearColor()rotationhas the default value of0