Swift 4.0 MapView Running Slow
Asked Answered
L

1

6

Ever since I updated to Xcode 9 and Swift 4.0, my mapView in my simulator has been running extremely slow. I thought this would be because code would be deprecated or because my code was extensive causing it to slow down, but I added a mapView into a blank project and that mapView is slow to navigate/zoom as well! Are there some settings I need to configure to fix this in the simulator?

This is the output produced in the console log:

2017-10-26 23:25:50.932530-0500 mapTest[7994:151068] [VKDefault] Tile 1.2.2 (256) in current unloaded state for 0.07 seconds - Polygons - Loading (ephemeral) (0.07 sec), Rivers - Loading (ephemeral) (0.07 sec), Roads - Loading (ephemeral) (0.07 sec), Point Labels - Loading (ephemeral) (0.07 sec), Polygon Labels - Loading (ephemeral) (0.07 sec), Road Labels - Loading (ephemeral) (0.07 sec), Resources - Unavailable (terminal) (2.11 sec), Attributes - Loading (ephemeral) (0.07 sec)
Lunatic answered 27/10, 2017 at 4:27 Comment(0)
C
5

If this is just in the simulator for ios 11 or 10.3, then it is a known bug. The XCode 9 simulator is working very slowly for everyone relating to mapKit. This bug can be seen here and here. It should, however, work fine if you use the app on your phone.

Apple staff working with Swift development have acknowledged the issue. The only workaround currently is using the ios 10 simulator or changing the rendering modules (suggested by Apple staff). Supposedly, changing the modules isnt perfect, but it might just help. Type this in terminal:

defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint X

Replace the X with: 0 = auto, 1 = Metal, 2 = OpenCL, 3 = OpenGL

Again, this is an official bug in the simulator so changing the rendering still won't make the simulation perfect. There have been 4-5 people who have submitted bug reports on this and it has been acknowledged, so hopefully a fix comes soon.

Edit

I tried a map kit app on iOS 11.1 simulator. It seems to be slightly smoother but the error message still pops up... waiting for a fix

Edit

A comment pointed out that this is fixed in the iOS 11.3 beta.

Cayenne answered 27/10, 2017 at 4:34 Comment(4)
Any known workarounds (reinstalling Xcode 8?) or a timetable for when this bug (based on other bugs) can be fixed? Kind of frustrating that people have had this issue since August.Lunatic
Yeah.... I haven’t found a workaround. I’m just using my phone as a tester, but that isn’t optimal since I can’t test my running app by running marathons every 5 minutes........Cayenne
I tried a map kit app on iOS 11.3 beta 1 simulator. It seems to be resolved.Near
What is the recommended rendering module for better performance, 0,1,2 0r 3?Ditch

© 2022 - 2024 — McMap. All rights reserved.