Swift
Install
Section titled “Install”Add the package from its distribution repository, which tags each release with its version. It needs Swift 6.2 or later.
.package( url: "https://github.com/maplibre/maplibre-native-ffi-distribution", exact: "0.202611.0")Then depend on its MaplibreNativeFFI product:
.product(name: "MaplibreNativeFFI", package: "maplibre-native-ffi-distribution")Choose a backend
Section titled “Choose a backend”The package uses your platform’s
default backend. To choose
another, enable the OpenGL or Vulkan trait:
.package( url: "https://github.com/maplibre/maplibre-native-ffi-distribution", exact: "0.202611.0", traits: ["Vulkan"])Android
Section titled “Android”Initialize the library once per process, before you create a runtime, with the
calling thread’s JNI environment and an Android Context:
try initAndroid( jniEnv: NativePointer(bitPattern: jniEnv), context: NativePointer(bitPattern: context))