Fix warnings in MapLibre iOS example app (#3857)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2025-10-06 20:23:26 +02:00
committed by GitHub
parent e64c3280a6
commit 4e7cfdffda
2 changed files with 9 additions and 4 deletions

View File

@@ -83,10 +83,15 @@ class CustomStyleLayer: MLNCustomStyleLayer {
}
"""
var error: NSError?
let device = resource.device
let library = try? device?.makeLibrary(source: shaderSource, options: nil)
assert(library != nil, "Error compiling shaders: \(String(describing: error))")
var library: MTLLibrary? = nil
var shaderError: Error? = nil
do {
library = try device?.makeLibrary(source: shaderSource, options: nil)
} catch {
shaderError = error
}
assert(library != nil, "Error compiling shaders: \(String(describing: shaderError))")
let vertexFunction = library?.makeFunction(name: "vertexShader")
let fragmentFunction = library?.makeFunction(name: "fragmentShader")

View File

@@ -24,7 +24,7 @@ class PrivacyExampleCoordinator: NSObject, MLNMapViewDelegate {
super.init()
}
@MainActor func mapView(_: MLNMapView, didChangeLocationManagerAuthorization manager: MLNLocationManager) {
func mapView(_: MLNMapView, didChangeLocationManagerAuthorization manager: MLNLocationManager) {
guard let accuracySetting = manager.accuracyAuthorization else {
return
}