Swift 4.0 MapView运行缓慢 [英] Swift 4.0 MapView Running Slow

查看:106
本文介绍了Swift 4.0 MapView运行缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我更新到Xcode 9和Swift 4.0以来,我的模拟器中的mapView运行非常慢.我以为这是因为不赞成使用代码,或者因为我的代码过于庞大而导致其速度变慢,但是我将mapView添加到了一个空白项目中,并且mapView导航/缩放也很慢!我需要配置一些设置才能在模拟器中解决此问题吗?

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)

推荐答案

如果这只是在ios 11或10.3的模拟器中,则它是一个已知的错误.对于与mapKit相关的每个人,XCode 9模拟器的运行速度都很慢.可以在此处

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.

从事Swift开发的Apple员工已经意识到了这个问题.当前唯一的解决方法是使用ios 10模拟器或更改渲染模块(Apple员工建议).据说,更改模块并不是完美的,但这可能会有所帮助.在终端中输入以下内容:

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

将X替换为:0 =自动,1 =金属,2 = OpenCL,3 = OpenGL

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

同样,这是模拟器中的一个正式错误,因此更改渲染仍然无法使模拟完美.已经有4-5个人提交了有关此问题的错误报告,并且该报告已经得到认可,因此希望可以尽快进行修复.

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.

修改

我在iOS 11.1模拟器上尝试了地图套件应用.看来略微平滑,但错误消息仍然弹出...等待修复

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

修改

一条评论指出,此问题已在iOS 11.3 beta中修复.

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

这篇关于Swift 4.0 MapView运行缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆