How to set objects around circle correctly on UIView : <p>I've write some code to place objects around circle that locate on center of the Custom view, but it not perfectly around the circle. I don't know where of the code is wrong.</p>

<p><a href="https://i.stack.imgur.com/HfTDD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HfTDD.png" alt="enter image description here"></a></p>

<p>Here is the code:</p>

<pre><code>func createObjectsAroundCircle() {

    let center = CGPointMake(bounds.width/2 ,bounds.height/2)
    let radius : CGFloat = 100
    let count = 20

    var angle = CGFloat(2 * M_PI)
    let step = CGFloat(2 * M_PI) / CGFloat(count)

    let circlePath = UIBezierPath(arcCenter: center, radius: radius, startAngle: CGFloat(0), endAngle:CGFloat(M_PI * 2), clockwise: true)

    let shapeLayer = CAShapeLayer()
    shapeLayer.path = circlePath.CGPath

    shapeLayer.fillColor = UIColor.clearColor().CGColor
    shapeLayer.strokeColor = UIColor.redColor().CGColor
    shapeLayer.lineWidth = 3.0

    self.layer.addSublayer(shapeLayer)

    // set objects around circle
    for var index = 0; index &lt; count ; index++ {
        let x = cos(angle) * radius + center.x
        let y = sin(angle) * radius + center.y

        let label = UILabel()
        label.text = "\(index)"
        label.frame.origin.x = x
        label.frame.origin.y = y
        label.font = UIFont(name: "Arial", size: 20)
        label.textColor = UIColor.blackColor()
        label.sizeToFit()

        self.addSubview(label)
        angle += step 
    }
}
</code></pre>
