I have been struggling with this for days but I still can't find a way to do it. Basically I have this map view and I am getting the annotations data (location,title,subtitle) from Parse, all I want to do is to replace the default pins with a custom one, I managed to customize one when I only use one annotation but for multiple it is not working, this is what I have for adding the annotations:
func setAnnotations(){
//Run query and get objects from parse, then add annotations
var query = PFQuery(className: "Countries")
query.orderByDescending("Location")
query.findObjectsInBackgroundWithBlock{
(objects:[AnyObject]?,error: NSError?)-> Void in
if error == nil{
let myObjects = objects as! [PFObject]
for object in myObjects{
//data for annotation
var annotation = MKPointAnnotation()
let place = object["Location"] as? PFGeoPoint
let placeName = object["nameEnglish"] as? String
annotation.title = placeName
annotation.subtitle = placeName
annotation.coordinate = CLLocationCoordinate2DMake(place!.latitude,place!.longitude)
//add annotations
self.mapView.addAnnotation(annotation)
}
}else{println(error)}
}
}
How would I apply the "dequeueReusableAnnotationViewWithIdentifier" here?