Fellow Devs, I'm trying to implement a polygon overlay on a mapview as follows:
private func drawOverlayForObject(object: MyStruct) {
if let coordinates: [CLLocationCoordinate2D] = object.geometry?.coordinates {
let polygon = MKPolygon(coordinates: coordinates, count: coordinates.count)
self.mapView.addOverlay(polygon)
}
}
The following error is presented:
Missing argument for parameter 'interiorPolygons' in call
According to the documentation: Apple Docu:
Mutable Pointers
When a function is declared as taking an UnsafeMutablePointer argument, it can accept any of the following:
- nil, which is passed as a null pointer
- An UnsafeMutablePointer value
- An in-out expression whose operand is a stored lvalue of type Type, which is passed as the address of the lvalue
- An in-out [Type] value, which is passed as a pointer to the start of the array, and lifetime-extended for the duration of the call
Now I think that my approach then would be correct, providing a [CLLocationCoordinate2D] array. Did anyone experience the same problem and found a workaround?
thanks Ronny