- Let's create a new Xcode project with the Single View Application template with the name BezierPath.
- The circular progress bar will consist of two layers: a fixed layer that will be added as a background for the progress bar and a progressive layer that will be animated.
- Now let's create a function that creates a circular layer so that we can reuse it for both layers. Add the following function in ViewController.swift:
private func getShapeLayerForRect(rect:CGRect, strokeColor sColor:UIColor) -> CAShapeLayer{ let radius = rect.width / 2 - progressLineWidth / 2 let newRect = CGRect(x: progressLineWidth / 2, y: progressLineWidth / 2, width: radius * 2, height: radius * 2) let path = UIBezierPath(roundedRect: newRect, cornerRadius: ...