Your addMarker
has an extra bracket.
func addMarker(place:EClass) {
guard let coordinates = place.location else {
return
}
self.destination = coordinates
// clear current marker
marker.map = nil
marker.position = coordinates
marker.title = place.name
marker.map = mapView
mapView.selectedMarker = marker
}
7
solved Can’t call a function in viewDidLoad [closed]