30

Using MapKit and SwiftUI (Version 12.0 beta 2 (12A6163b)) when zooming in/out around the map the terminal produces hundreds of these lines:

2020-07-21 21:05:39.310719-0500 MyApp[95733:4195994] [VKDefault] Style Z is requested for an invisible rect

import SwiftUI
import MapKit

@main
struct MapTest: App {
    var body: some Scene {
        WindowGroup {
            MapView()
        }
    }
}

struct MapView: View {
    var body: some View {
        Map()
    }
}

struct MapView_Previews: PreviewProvider {
    static var previews: some View {
        MapView()
    }
}

struct Map: UIViewRepresentable {
    func makeUIView(context: Context) -> MKMapView {
        
        let map = MKMapView()
        map.delegate = context.coordinator
        return map
    }
    
    func updateUIView(_ uiView: MKMapView, context: Context) {}

    func makeCoordinator() -> Coordinator {
        Coordinator(self)
    }
    
    final class Coordinator: NSObject, MKMapViewDelegate {
        var control: Map
        
        init(_ control: Map) {
            self.control = control
        }
    }
}

How do I fix this?

0

1 Answer 1

0

This is a really common problem since Xcode 12.0, but for now the only solution seems to disable an Environment Variables called "OS_ACTIVITY_MODE".

You have to edit your Scheme, go to Run section, add another Environment Variables, call it "OS_ACTIVITY_MODE" and set "disable" as value.

This prevents messages on log console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.