I am trying to make a simple mapbox map iOS app. I followed the installation guide (triple checking the netrc file) and copy pasted the "Display a simple map view" example. I get the error "Cannot find 'ResourceOptions' in scope".
See the code below...note it is example code from mapbox and is not mine...
import UIKit
import MapboxMaps
class ViewController: UIViewController {
internal var mapView: MapView!
override public func viewDidLoad() {
super.viewDidLoad()
// Create a map view.
let myResourceOptions = ResourceOptions(accessToken: "your_public_access_token") //error here
let myMapInitOptions = MapInitOptions(resourceOptions: myResourceOptions) //error here
mapView = MapView(frame: view.bounds, mapInitOptions: myMapInitOptions)
// Center the map camera over Stockholm.
mapView.mapboxMap.setCamera(
to: CameraOptions(
center: CLLocationCoordinate2D(
latitude: 59.31,
longitude: 18.06
),
zoom: 9.0
)
)
// Add the map.
self.view.addSubview(mapView)
}
}
I have done the troubleshooting steps mapbox provides (clean build, cache, etc.), remade my entire simple app, reading the docs, and tried googling this error. Apparently, nothing works and google doesn't provide much. Please advise.