I'm creating Native Module for React Native. I'm trying to process the data in Swift, here's the function
func getCornerPoints(_ cornerPoints: [AnyHashable]?) -> [AnyHashable]? {
var result: [AnyHashable] = []
if cornerPoints == nil {
return result
}
for point in cornerPoints ?? [] {
guard let point = point as? NSValue else {
continue
}
var resultPoint: [AnyHashable: Any] = [:]
resultPoint["x"] = NSNumber(value: Float(point.cgPointValue.x))
resultPoint["y"] = NSNumber(value: Float(point.cgPointValue.y))
result.append(resultPoint) // error is here "No exact matches in call to instance method 'append'"
}
return result
}