Quickstart
A SwiftUI app for iPhone that shows a topographic map and draws the Tour du Mont-Blanc on it.
You need Xcode with Swift 6.2.3 or newer, an iOS 17 simulator or device, and a publishable key with the tiles and publishing scopes from Organization → API keys in the Mountaya app.
Create an iOS App project in Xcode with SwiftUI. Choose File → Add Package Dependencies, paste https://github.com/mountaya/sdk-swift, and add MountayaClient, MountayaGeo and MountayaElements to the app target. Then turn on the package's Elements trait under Package Dependencies in the project settings.
Add a Local.xcconfig that git ignores, set it as the target's configuration file, and pass the key to Info.plist:
Replace the app's Swift file with this:
MapEngine holds what the map shows, and MapView draws it.
Replace TrailMap with this version. It draws the itinerary and fits the camera to it:
Run the app on an iPhone simulator. The map opens on the Tour du Mont-Blanc, with the Mountaya watermark in its top-left corner.