Meet MapKit for SwiftUI Error

I keep receiving this error:

Value of type 'MKDirections.Response?' has no member 'route'

Here is my code:

Task { let directions = MKDirections(request: request) let response = try? await directions.calculate() route = response.route.first }

any pointers on how to fix?

Thanks!

Replies

You'll want to use response.routes.first

Yep, that did it. GHeez, couldn't see it.

thank you!

  • I recognized the problem immediately because I did the exact same thing a few days earlier.

Add a Comment