swiftui – Running MapKit/iOS 17 via Xcode 15 on my iPhone 12 creates runtime complaints. Why?


Environment: iOS 17/macOS 14 with SwiftUI via Xcode 15

Scenario: Building MapKit demo using the latest MapKit edition (WWDC23).
Problem/Concern: Getting unexpected console warnings when running on iOS 12 device.

Here’s my code:

import MapKit
import SwiftUI

struct ContentView: View {
    @Namespace private var myHomeMap
    @Namespace private var appleParkMap
    
    @State private var cameraPosition: MapCameraPosition = .region(.appleParkRegion)
    
    var body: some View {
        Map(position: $cameraPosition, scope: appleParkMap) {
            Annotation("Apple Park", coordinate: Locations.ApplePark) {
                ZStack {
                    Image(systemName: "applelogo")
                        .font(.title3)
                    Image(systemName: "square")
                        .font(.largeTitle)
                }
            } .annotationTitles(.hidden)
            UserAnnotation() // ...when we have to Phone Location, this will show the current user's location on the map.
        }
        .overlay(alignment:.bottomTrailing) {
            VStack(spacing: 15) {
                MapCompass(scope: appleParkMap)
                MapPitchToggle(scope: appleParkMap)
                MapUserLocationButton(scope: appleParkMap)
            }
            .buttonBorderShape(.circle)
            .padding()
        }
        .mapScope(appleParkMap)
    }
}

#Preview {
    ContentView()
}

Here’s what I’m getting:

Missing MeshRenderables for ground mesh layer for (4/4) of ground tiles. Tile debug info: (Key: 329.794.11.255 t:33 kt:0, Has mesh errors: 0, MeshInstance count: 1, PendingMaterial count: 1, Invisible
MeshInstances count: 0 | Key: 330.794.11.255 t:33 kt:0, Has mesh errors: 0, MeshInstance count: 1, PendingMaterial count: 1, Invisible
MeshInstances count: 0 | Key: 329.795.11.255 t:33 kt:0, Has mesh errors: 0, MeshInstance count: 1, PendingMaterial count: 1, Invisible
MeshInstances count: 0 | Key: 330.795.11.255 t:33 kt:0, Has mesh errors: 0, MeshInstance count: 1, PendingMaterial count: 1, Invisible
MeshInstances count: 0) CLLocationManager(<CLLocationManager: 0x2827ec280>) for <MKCoreLocationProvider: 0x2817f0900> did fail with error: Error Domain=kCLErrorDomain Code=1 “(null)”

Why?
Remedy?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img