as the document says the cornerRadius can not larger than half width, but in my code it only 1/3 of the width the round rect become a circle, can't know why? need help
document: https://developer.apple.com/documentation/uikit/uibezierpath/1624356-init
cornerRadius: The radius of each corner oval. A value of 0 results in a rectangle without rounded corners. Values larger than half the rectangle’s width or height are clamped appropriately to half the width or height.
var path = UIBezierPath(roundedRect: CGRect(x: 50, y: 200, width: 94, height: 94), cornerRadius: 31)
path.stroke()
path = UIBezierPath(roundedRect: CGRect(x: 50, y: 300, width: 94, height: 94), cornerRadius: 30.5)
path.stroke()
path = UIBezierPath(roundedRect: CGRect(x: 50, y: 400, width: 94, height: 94), cornerRadius: 31.5)
path.stroke()

I think it is because of a type casting error.
Try this.
PS: didnt check by running this code let me know if there is any problem here.