I get this error and new to Swift. I want to take the last 5 points of the array> = 5 and pass these 5 points as an argument to the array of the function. How can I achieve this and overcome this error?
Cannot convert value of type "ArraySlice" to the expected argument type "[CGPoint]"
if (self.points?.count >= 5) { let lastFivePoints = self.points![(self.points!.count-5)..<self.points!.count] let angle = VectorCalculator.angleWithArrayOfPoints(lastFivePoints) }
arrays swift
chris P
source share