Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 views
in Technique[技术] by (71.8m points)

mkmapview - Swift 4.0 MapView Running Slow

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...