I have installed and imported TomTomSDKMapDisplay
into my Xcode project and am trying to display a map on a view. Following the TomTom Developer instructions, I am trying to assign my api key. Here is the link to the instructions I have been following (this is my first time attempting to make use of APIs in Xcode): https://developer.tomtom.com/ios/maps/documentation/guides/map-display/quickstart#getting-the-map
However, when MapsDisplayService.apiKey = "ThisIsKey"
is placed in var body: some View {
, the error
Type '()' cannot conform to 'View'
is given. Where then am I supposed to write this line? Below is a screen shot of the code.
According to the documentation, if you want to set the API key, you need to do it before a MapView can be used. As an example, this can be done in the didFinishLaunchingWithOptions delegate method.
Then in your View class, you can instantiate the MapView.