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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With