Creating Coordinates from Addresses in Data

I have a data set of stores. The data include the stores’ addresses, but not their coordinates, so I need to make sure the coordinates are included in the data model to calculate and display their distance from the user’s home address. I am trying to have the coordinates calculated when the data load, and stored into their own properties.

I have tried more ways than I can count to take the addresses and turn them into coordinates using geocodeAddressString(). Putting the code with the model as a computed property creates an error about an initializer. Putting the code with the function to pull the data returns an error about not being able to apply the method to type ‘DataServiceBookstores’. The closest I have gotten is putting the code in my ViewModel:

import Foundation
import MapKit

class BookstoreModel:ObservableObject {
    @Published var bookstores = [Bookstore]()
    init() {
        let serviceBookstores = DataServiceBookstores()
        self.bookstores = DataServiceBookstores.getLocalDataBookstores()
        for r in self.bookstores {
            r.latitude = try! await getCoordinate(from: r.address)
        func getCoordinate(from address: String) async throws -> Double {
            let geocoder = CLGeocoder()

            guard let location = try await geocoder.geocodeAddressString(address)
                .compactMap( { $0.location } )
                .first(where: { $0.horizontalAccuracy >= 0 } )
            else {
                throw CLError(.geocodeFoundNoResult)

            return location.coordinate.latitude


But this throws up an error about “‘async’ call in a function that does not support concurrency”.

Does anyone know what I can do?