cost 283 ms
延迟在 swift 中获取 requiredOutput 并因此得到意外结果 - Delay in getting requiredOutput in swift and getting unexpected result because of that

这是我打电话的function,它使用经纬度,将它们转换为城市名称和国家名称,然后根据我的需要返回城市名称或国家名称。 但是在这个 function 中,当我调用 function 时,我的局部变量没有更新,也没有打印任何内容,但几秒钟后,它将局部变量分配给 cityName 并打印它。 Outp ...

使纬度和经度数据字符串在各种视图中作为 CLLocation 坐标可访问并创建地图路线? - Make strings of latitude and longitude Data accessible as CLLocation Coordinates in various views and create a Map-route?

我有两个字符串代表路线的纬度和经度数据。 他们总共有大约 900 个条目。 我想将它们转换为 CLLocation 坐标,然后使用这些坐标在不同的视图中将路线创建为 Map 折线叠加层。 所以。 我对两个问题特别感兴趣: 将字符串转换为坐标使坐标可以被不同的视图访问(也许是 Environment ...

reverseGeocodeLocation(_ location: CLLocation) 方法是否在离线模式下工作? - Does reverseGeocodeLocation(_ location: CLLocation) method works in offline mode?

我从方法reverseGeocodeLocation(_ location: CLLocation)获取位置名称。 我的要求是在离线模式下将 Lat-Long 值存储在 DB 中,我还想存储从上述方法获得的这个位置名称字符串。 这是我已经实现的: 我绝对可以在离线模式下获得lat-long; 我的 ...

如何使用 SwiftUI 中的扩展将 Hashable 协议添加到 CLLocationCoordinate2D - How to add the Hashable protocol to CLLocationCoordinate2D using an extension in SwiftUI

所以我有一个自定义结构,其中一个属性为 String 类型,另一个属性为 CLLocationCoordinate2D。 显然,String 符合 Hashable,如果我可以扩展 CLLocationCoordinate2D 以符合 Hashable,我的自定义结构也将是 Hashable。 这 ...

仅在 Swift 中点击按钮后更新速度 - Updating speed only after button tapped in Swift

我正在制作一个实时测量速度和距离的应用程序。 所以之前那个应用程序在点击按钮时开始更新位置。 但是这种方法在点击按钮后需要时间。 如果我将 locationManager.startUpdatingLocation 放在 viewDidLoad 中,则无需点击开始按钮即可立即开始测量速度和距离。 只 ...

Swift - 可编码解码 CLLocation 数组的数组 - Swift - Codable Decode array of arrays of CLLocation

我有一个包含 CLLocations 数组的结构体。 这是为了支持多折线(换句话说,一堆可能不连续的线)。 我希望对这些数据进行编码和解码。 我在编写编码和解码方法时遇到问题,因为默认情况下 CLLocation 不可编码。 struct MyTrack { let coords ...

如何设置 MKMapView 区域以缩放到 userLocation 的精度? - How to set MKMapView region to zoom to the accuracy of the userLocation?

我有一个按钮,点击时应该转到用户的当前位置。 地图应以该坐标为中心并放大或缩小其位置,以便准确度圆在屏幕上完全可见。 这在 iOS 14 上尤其重要,因为在这种情况下,圆圈非常大,他们可能不会授予访问其精确位置的权限。 目前我有: 现在在禁用精度的情况下运行此代码, horizontalAcc ...

创建自定义形状多边形作为地理围栏区域? - Create a custom shape polygon as a region for geofencing?

目前我们有一个坐标数组,坐标将勾勒出一个矩形形状。 截至目前,它要求一个圆形区域来监控: 我们想要的是适合坐标形状的地理围栏。 几年前我看到这篇文章说你不能创建自定义区域: 自定义形状区域 这甚至可以创建自定义形状区域吗? ...

如何在 IOS Swift 中获取准确的当前位置坐标(纬度/经度) - How to get accurate current location coordinates (latitude/longititude) in IOS Swift

我在 IOS Swift 中使用 CoreLocation 来获取当前坐标,但在某些情况下,它让我最接近我想要的位置,而有时坐标距离我给定的地址有很多米。 请检查我正在使用的代码是否有其他方法可以获得准确的当前位置坐标。? 我的代码是: 请帮助我一段时间当前位置是准确的,有时它太远了。 谢谢 ...

跟踪用户位置。 MKPolyline 从 UTC 坐标 (0, 0) 绘制到当前位置 - Tracking user location. MKPolyline getting drawn from UTC coordinates (0, 0) to current location

我正在制作一个跟踪用户所走路线的应用程序。 我正在为horizo ntalAccuracy >0 的每个位置更新删除 MKPointAnnotation。 然后我试图从一点到另一点绘制MKPolyline 。 这在按下开始按钮时开始。 在按下开始按钮之前, MKMapView会显示当前位置,这 ...

CLLocationManager:在 iOS 13 中未调用 didChangeAuthorizationStatus - CLLocationManager: didChangeAuthorizationStatus not called in iOS 13

我有一个应用程序已经运行了好几年,但定位服务在较新的 iPhone 上无法正常运行 iOS 13。 在 7 及以下版本上运行良好。 初始化 CLLocationManager 时,不会调用 CLLocationManager: didChangeAuthorizationStatus 方法。 这是 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM