import SwiftUI
import Mapbox
import MapboxAnnotationExtension
import MapboxDirections
import MapboxCoreNavigation
import MapboxNavigation
/****** some classes for different types of annotations
struct MapboxRepresent: UIViewRepresentable {
................
class Coordinator: NSObject, MGLMapViewDelegate {
func mapView(_ mapView: MGLMapView, tapOnCalloutFor annotation: MGLAnnotation) {
let navigationViewController = NavigationViewController(for: directionsRoute!)
navigationViewController.modalPresentationStyle = .fullScreen
!!!! -> present(navigationViewController, animated: true, completion: nil)
// here is error - Use of unresolved identifier 'present'
}
}
.................
}
Этот код работает правильно; он показывает карту и все аннотации. Функция для крана только для тестирования. Поскольку я новичок в SwiftUI5, я не могу понять, как решить эту проблему.