Can't call a function in viewDidLoad : <p>I created this function in my controller</p>

<pre><code>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

    }
}
</code></pre>

<p>and now i'm trying to call it in my viewDidLoad because i want to add some markers in my mapView</p>

<pre><code>override func viewDidLoad() {
        super.viewDidLoad()
        print(categories as Any)

        guard let currentUser = Auth.auth().currentUser else {
            return
        }



        tableView.dataSource = self
        tableView.delegate = self

        dateFormatter.timeZone = TimeZone.current
        dateFormatter.dateFormat = "hh:mm"
        print(dateFormatter.string(from: NSDate() as Date))


         mapView.isMyLocationEnabled = true
         locationManager?.startUpdatingLocation()


         //HERE 
         let srt = sortedArray
         for category in categories! {
            addMarker(place: srt)
        }



}
</code></pre>

<p>but i'm getting the error "Use of unresolved identifier 'addMarker'" , why? How can i fix it?</p>
