swift5使用未声明的类型'CLLocaitonDegress'

问题描述

我试图从我的应用程序中获取经度和纬度的值。 但此消息出现“使用未声明的类型'CLLocaitonDegress'的错误”。 我不明白我的代码怎么了?

func fetchWeather(latitude: CLLocaitonDegress,longitude: CLLocationDegrees) {
        let urlString = "\(weatherURL)&lat=\(latitude)&lon=\(longitude)"
        performRequest(urlString: urlString)
    }

//MARK: -CLLocationManagerDelegate

extension WeatherViewController: CLLocationManagerDelegate {
    func locationManager(_ manager: CLLocationManager,didUpdateLocations locations: [CLLocation]) {
        if let location = locations.last {
            let lat: Double = location.coordinate.latitude
            let lon: Double = location.coordinate.longitude
            weatherManager.fetchWeather(cityName: String,latitude: lat,longitude: lon)
        }
    }
    
    func locationManager(_ manager: CLLocationManager,didFailWithError error: Error) {
        print("error")
    }
    
}


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)