## version-6.0
### Additional Guides
# Additional Guides
>
Additional guides for Mappedin SDK for iOS v6 are coming soon.
### API Reference
# API Reference
## Latest Version
Mappedin SDK for iOS v6.0.0-alpha.0
## Previous Versions
### Getting Started
# Getting Started
>
Mappedin SDK for iOS helps to deliver the rich indoor mapping experience of a venue, inside iOS apps.
The Mappedin SDK for iOS is a native interface to Mappedin JS. The SDK is a dependency built using Swift, and it automatically handles any authentication, network communication, fetching of map data, its display, and basic user interaction, such as panning, tapping, and zooming. The SDK allows a developer to build their own interactions. Additional layers can be rendered on top of the map.
:::info
Mappedin SDK for iOS is supported on iOS versions 13.0 and above.
:::
## Coding with AI
Mappedin SDK for iOS provides an llms-mappedin-ios.txt file that can be used to help with coding when using Large Language Models (LLMs).
## Xcode Project Setup
### Add Mappedin SDK Using Swift Package Manager
Add the Mappedin SDK to your Xcode project using Swift Package Manager:
1. In Xcode, go to **File > Add Package Dependencies**
2. Enter the repository URL: `https://github.com/MappedIn/ios.git`
3. Select version `6.0.0-alpha.0`
4. Click **Add Package**
Alternatively, you can add the package dependency to your `Package.swift` file:
```swift
dependencies: [
.package(url: "https://github.com/MappedIn/ios.git", from: "6.0.0-alpha.0")
]
```
The latest version can be found in the iOS GitHub repository releases.
### Add Permissions
If you plan to display user location, add the following permissions to your `Info.plist` file:
```xml
NSLocationWhenInUseUsageDescription
This app needs access to your location to show you on the map
NSLocationAlwaysAndWhenInUseUsageDescription
This app needs access to your location to show you on the map
NSBluetoothAlwaysUsageDescription
This app uses Bluetooth to determine your location inside buildings
```
Update the description strings to match your app's specific use case.
:::tip
The Mappedin iOS Github repository contains a reference project that demonstrates how to use the Mappedin SDK for iOS.
:::
### Display a Map
The core class of the Mappedin SDK for iOS is MapView, which is responsible for instantiating an WKWebView that loads Mappedin JS. MapView is the core class of which all other views and data models can be accessed.
#### Load Map Data
Call MapView.getMapData/) to load map data from Mappedin servers. This function must be called first and map data must be loaded before any other Mappedin functions can be called.
```kotlin
// See Trial API key Terms and Conditions
// https://developer.mappedin.com/docs/demo-keys-and-maps
let options = GetMapDataWithCredentialsOptions(
key: "mik_yeBk0Vf0nNJtpesfu560e07e5",
secret: "mis_2g9ST8ZcSFb5R9fPnsvYhrX3RyRwPtDGbMGweCYKEq385431022",
mapId: "660c0c6e7c0c4fe5b4cc484c"
)
// Load the map data.
mapView.getMapData(options: options) { [weak self] r in
guard let self = self else { return }
if case .success = r {
print("getMapData success")
} else if case .failure(let error) = r {
print("getMapData error: \(error)")
}
}
```
#### Show a Map
Call MapView.show3dMap/) to display the map.
```swift
self.mapView.show3dMap(options: Show3DMapOptions()) { r2 in
if case .success = r2 {
print("show3dMap success")
}
}
```
The following sample code combines the loading of map data and the display of the map and includes a function to be called when the map is ready.
```swift
import UIKit
import Mappedin
final class DisplayMapDemoViewController: UIViewController {
private let mapView = MapView()
private let loadingIndicator = UIActivityIndicatorView(style: .large)
override func viewDidLoad() {
super.viewDidLoad()
title = "Display a Map"
view.backgroundColor = .systemBackground
let container = mapView.view
container.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(container)
// Add loading indicator
loadingIndicator.translatesAutoresizingMaskIntoConstraints = false
loadingIndicator.startAnimating()
view.addSubview(loadingIndicator)
NSLayoutConstraint.activate([
container.leadingAnchor.constraint(equalTo: view.leadingAnchor),
container.trailingAnchor.constraint(equalTo: view.trailingAnchor),
container.topAnchor.constraint(equalTo: view.topAnchor),
container.bottomAnchor.constraint(equalTo: view.bottomAnchor),
loadingIndicator.centerXAnchor.constraint(equalTo: view.centerXAnchor),
loadingIndicator.centerYAnchor.constraint(equalTo: view.centerYAnchor),
])
// See Trial API key Terms and Conditions
// https://developer.mappedin.com/docs/demo-keys-and-maps
let options = GetMapDataWithCredentialsOptions(
key: "mik_yeBk0Vf0nNJtpesfu560e07e5",
secret: "mis_2g9ST8ZcSFb5R9fPnsvYhrX3RyRwPtDGbMGweCYKEq385431022",
mapId: "64ef49e662fd90fe020bee61"
)
// Load the map data.
mapView.getMapData(options: options) { [weak self] r in
guard let self = self else { return }
if case .success = r {
print("getMapData success")
// Display the map.
self.mapView.show3dMap(options: Show3DMapOptions()) { r2 in
if case .success = r2 {
DispatchQueue.main.async {
self.loadingIndicator.stopAnimating()
}
self.onMapReady()
} else if case .failure(let error) = r2 {
DispatchQueue.main.async {
self.loadingIndicator.stopAnimating()
}
print("show3dMap error: \(error)")
}
}
} else if case .failure(let error) = r {
print("getMapData error: \(error)")
}
}
}
// Place your code to be called when the map is ready here.
private func onMapReady() {
print("show3dMap success - Map displayed")
}
}
```
#### Result
The app should display something that looks like this in the iPhone Emulator:
And zooming in to have a closer look:
## Create a Key & Secret
## Debug Mode
Use Debug Mode to get a closer look at how various map components behave and interact. Here's how to enable it:
### 1. Enable Debug Mode
To activate the debug interface, call the following function in your code:
```swift
mapView.enableDebug()
```
MapView.enableDebug/) displays a panel on the right side of the map, revealing several tools and controls for direct interaction with the map's elements.
### 2. Navigating the Debug Panel
The debug panel provides access to a variety of controls:
**Geometry Controls**
- Adjust individual geometry settings, such as color, opacity, visibility. These controls make it easy to see how different elements respond to changes.
**Interactivity**
- Use toggles to turn interactivity on/off
- Change colors and hover effects to highlight specific areas
**Scene Controls**
- Manage the overall scene settings, such as scaling, positioning, and group management. Toggle the visibility of groups or containers within the scene
- Adjust padding, scale, and watermark positioning
- Markers & Labels — Add, remove, or edit markers and labels directly through the panel
**Camera Controls**
- Fine-tune camera settings, including zoom levels, pitch, and center position
- Set minimum and maximum zoom levels
- Adjust the focus to a specific area or level
!enable debug
### Release Notes
# Release Notes
Mappedin SDK for iOS release notes are posted here and this page will be kept up-to-date as updates are released.
{
// Release notes template:
// https://keepachangelog.com/en/1.0.0/#how
// ## vXX.XX.XX - Month Day, Year
// _ Added
// _ Changed
// _ Deprecated
// _ Removed
// _ Fixed
// _ Security
}
## v6.0.0-alpha.0 - December 12, 2025
- Initial release of Mappedin SDK for iOS v6.