Cómo configurar una matriz para anotaciones múltiples con Swift
¿Cómo se debe establecer la matriz a continuación? Estoy tratando de agregar múltiples anotaciones en mi mapa. Pude encontrar el siguiente código en stackoverflow pero no mostraron cómo configurar la matriz.
var objects = [
//how should the array be setup here
]
for objecters in objects!{
if let latit = objecters["Coordinates"]["Latitude"]{
self.latitudepoint = latit as! String
self.map.reloadInputViews()
}
else {
continue
}
if let longi = objecters["Coordinates"]["Longitude"]{
self.longitudepoint = longi as! String
self.map.reloadInputViews()
}
else {
continue
}
var annotation = MKPointAnnotation()
var coord = CLLocationCoordinate2D(latitude: Double(self.latitudepoint)!,longitude: Double(self.longitudepoint)!)
mapView.addAnnotation(annotation)
}