Swift Error: Cannot convert value of type ‘ArraySlice’ to expected argument type

You need to convert ArraySlice to Array using method Array(Slice<Type>)

if (self.points?.count >= 5) {
    let lastFivePoints = Array(self.points![(self.points!.count-5)..<self.points!.count])
    let angle = VectorCalculator.angleWithArrayOfPoints(lastFivePoints)
}

Leave a Comment