ios - 有没有办法随着时间的推移模拟多个位置,比如设备上的 'City Run'?

标签 ios objective-c

目前,在 iOS 模拟器中,您可以模拟城市运行,它会随着时间的推移而改变您的位置。 您还可以在 iOS 设备上模拟您的位置,但只能模拟单个坐标。是否可以在设备上模拟城市运行之类的东西?

最佳答案

我会考虑使用 GPX 文件 ( http://wiki.openstreetmap.org/wiki/GPX )。类似于您如何模拟找到的位置 https://developer.apple.com/library/ios/recipes/xcode_help-debugger/articles/simulating_locations.html您可以上传包含多个 GPS 点等信息的 GPX 文件。

另一个选项取决于您正在尝试做什么,是使用 CLLocationManager 的子类从文件中读取数据。这里有一个这样的例子 ( https://github.com/Raizlabs/RZLocationSimulationManager/tree/develop ) 不幸的是没有任何示例代码,但你应该能够从代码中了解它是如何完成的。

关于ios - 有没有办法随着时间的推移模拟多个位置,比如设备上的 'City Run'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29848081/

相关文章:

ios - 使用 Alamofire 将图像加载到 UITableViewCell 并圆角

iphone - 我的 Default.png 使用什么样的图像?我正在使用 iPhone 5's native resolution WITH the status bar, but it won' t 工作

iphone - 我想以编程方式从照片库中删除图像?

objective-c - 如何关闭UIWebView水平弹跳

ios - 由嵌入在 UITabBarController 中的 UINavigationController 呈现的 View 不会调整 View 大小以考虑 View 底部的 tabBar

ios - 以编程方式将文本放入 UIView

ios - SKAction.playSoundFileNamed -- 如何将音量设置在 0.0 - 1.0 之间

ios - 在导航 Controller 之外制作 UIViewController

objective-c - 在init方法中确定类

ios - 将本地包中的图像发布到 Pinterest iphone。