Map Annotations

Trying to add a group of annotations from my core data. Spinning my tires right now, thanks for any guidance:

fileprivate func addAnnotationOnMap() {
// userLocation = UserLocation(context: self.moc)
// var annotation = MKAnnotation
for userLocation in userLocations {
let annotation = MKPointAnnotation()
annotation.coordinate = CLLocationCoordinate2D(latitude: userLocation.latitude, longitude: userLocation.longitude)
annotation.title = userLocation.detail
// annotation.append(annotation)

Value of type '(MKMapView, [MKAnnotationView]) -> ()' has no member 'addAnnotation'


try the plural: mapView.addAnnotations()

thank you, I did try that no difference.

Thanks all I got it by putting code inside makeUIView func.