小编Mil*_*Yin的帖子

[iOS][FoursquareAPI] 错误:[连接] nw_resolver_start_query_timer_block_invoke

我尝试根据用户的位置从 Foursquare 中提取一些餐厅数据,但出现了一堆查询错误。

这是位置代码:

protocol UserLocationDelegate {
    func tracingLocation(currentLocation: CLLocation)
}
class UserLocation: NSObject {
    static let shared = UserLocation()
    
    var delegate: UserLocationDelegate?
    var userCurrentLocation: CLLocationCoordinate2D?
    var locationManager: CLLocationManager?
    
    func locationManagerStart() {
        if locationManager == nil {
            locationManager = CLLocationManager()
            locationManager?.requestWhenInUseAuthorization()
            locationManager?.distanceFilter = 1000
            locationManager?.desiredAccuracy = kCLLocationAccuracyBest
            locationManager?.delegate = self
            
        }
        locationManager?.startUpdatingLocation()
    }
    func locationManagerStop() {
        if locationManager != nil {
            locationManager?.stopUpdatingLocation()
        }
    }
    private func upataLocation(currentLocation: CLLocation) {
        delegate?.tracingLocation(currentLocation: currentLocation)
        
    }
    
}

extension UserLocation: CLLocationManagerDelegate {
    
    func locationManager(_ manager: …
Run Code Online (Sandbox Code Playgroud)

foursquare ios swift

7
推荐指数
0
解决办法
2287
查看次数

标签 统计

foursquare ×1

ios ×1

swift ×1