How do I change the code since C style for statement is deprecated in swift 3? I am getting an error on the following line of code:
for var frame = 0; frame <= frameCount; frame += 1
func keyframePathsWithDuration(_ duration: CGFloat, lastUpdatedAngle: CGFloat, newAngle: CGFloat, radius: CGFloat, type: RMIndicatorType) -> [CGPath] {
let frameCount: Int = Int(ceil(duration * 60))
var array: [CGPath] = []
for var frame = 0; frame <= frameCount; frame += 1 {
let startAngle = degreeToRadian(-90)
let angleChange = ((newAngle - lastUpdatedAngle) * CGFloat(frame))
let endAngle = lastUpdatedAngle + (angleChange / CGFloat(frameCount))
array.append((self.pathWithStartAngle(startAngle, endAngle: endAngle, radius: radius, type: type).cgPath))
}
return array
}