Friday, March 15, 2024
HomeiOS Developmentios - SwiftUI: MapKit + Thread Efficiency Checker

ios – SwiftUI: MapKit + Thread Efficiency Checker


i simply tried to implement a Map with MapKit in a SwiftUI app.

I’m utilizing this code:

import MapKit
import SwiftUI

struct ContentView: View {
    var physique: some View {
        Map()
            .mapStyle(.commonplace) // This isn't vital as it's the default mapStyle
    }
}

Up to now so good, however when i attempt to change the model of the map by utilizing a distinct
.mapStyle()

like this:

struct ContentView: View {
    var physique: some View {
        Map()
        .mapStyle(.hybrid) // >>>> Results in Thread Efficiency Checker console output
    }
}

or this:

struct ContentView: View {
    var physique: some View {
        Map()
        .mapStyle(.imagery) // >>>> Results in Thread Efficiency Checker console output
    }
}

i get a message within the console:

Thread Efficiency Checker: Thread working at Person-interactive quality-of-service class ready on a thread with no QoS class specified (base precedence 0). Examine methods to keep away from precedence inversions
PID: 20317, TID: 1218480
Backtrace
=================================================================
3   CMPhoto                             0x00000001bd48401c EA7CA3FB-45FC-3BE7-BAE8-2376F457E0EE + 266268
4   CMPhoto                             0x00000001bd48289c EA7CA3FB-45FC-3BE7-BAE8-2376F457E0EE + 260252
5   CMPhoto                             0x00000001bd482400 EA7CA3FB-45FC-3BE7-BAE8-2376F457E0EE + 259072
6   CMPhoto                             0x00000001bd44d440 EA7CA3FB-45FC-3BE7-BAE8-2376F457E0EE + 42048
7   CMPhoto                             0x00000001bd46a668 EA7CA3FB-45FC-3BE7-BAE8-2376F457E0EE + 161384
8   CMPhoto                             0x00000001bd46a5dc CMPhotoDecompressionContainerCreateImageForIndex + 280
9   ImageIO                             0x000000019de372a4 F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 234148
10  ImageIO                             0x000000019dfd433c F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 1925948
11  ImageIO                             0x000000019de36734 F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 231220
12  ImageIO                             0x000000019de35f6c F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 229228
13  ImageIO                             0x000000019de34ebc F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 224956
14  ImageIO                             0x000000019de347b4 F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 223156
15  ImageIO                             0x000000019de3441c F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 222236
16  ImageIO                             0x000000019de34050 F39503B4-AD21-3FE3-9AF2-11C6406E46FB + 221264
17  libCGInterfaces.dylib               0x000000022d0962a8 9E58EA02-ACA2-3DD0-B549-7C4D973B003F + 25256
18  libCGInterfaces.dylib               0x000000022d094e80 9E58EA02-ACA2-3DD0-B549-7C4D973B003F + 20096
19  VectorKit                           0x00000001b58fe70c 75195D59-5670-3494-8B35-3F99E78BB358 + 6043404
20  VectorKit                           0x00000001b5dd2fbc 75195D59-5670-3494-8B35-3F99E78BB358 + 11108284
21  VectorKit                           0x00000001b5751270 75195D59-5670-3494-8B35-3F99E78BB358 + 4285040
22  VectorKit                           0x00000001b574f87c 75195D59-5670-3494-8B35-3F99E78BB358 + 4278396
23  GeoServices                         0x000000019e92a734 4EF7FB5D-FB2E-33A8-9CFD-82B79F82C945 + 3647284
24  GeoServices                         0x000000019e9360fc 4EF7FB5D-FB2E-33A8-9CFD-82B79F82C945 + 3694844
25  libdispatch.dylib                   0x0000000104e87764 _dispatch_block_async_invoke2 + 148
26  libdispatch.dylib                   0x0000000104e767bc _dispatch_client_callout + 20
27  libdispatch.dylib                   0x0000000104e798e0 _dispatch_continuation_pop + 676
28  libdispatch.dylib                   0x0000000104e78bb8 _dispatch_async_redirect_invoke + 680
29  libdispatch.dylib                   0x0000000104e8aae4 _dispatch_root_queue_drain + 404
30  libdispatch.dylib                   0x0000000104e8b4d8 _dispatch_worker_thread2 + 188
31  libsystem_pthread.dylib             0x00000001f4224ee4 _pthread_wqthread + 228
32  libsystem_pthread.dylib             0x00000001f4224fc0 start_wqthread + 8 

My query is: Is it protected to make use of one in all these completely different mapStyles or ought to i wait till Apple fixes it?

I attempted each mapStyle, performed round with the parameters: elevation, emphasis, pointsOfInterest and showsTraffic however solely the commonplace model did not gave me the difficulty.


Xcode Model 15.3 (15E204a)
iOS 17.4 Deployment Goal.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments