Firebase 如何更新可以使用iOS 14功能的Xcode代码?
我正在观看一个关于如何在swift中获取用户位置的教程,我在这里遇到了一个问题:Firebase 如何更新可以使用iOS 14功能的Xcode代码?,firebase,ios13,ios14,Firebase,Ios13,Ios14,我正在观看一个关于如何在swift中获取用户位置的教程,我在这里遇到了一个问题: class teste: CLLocationManager, CLLocationManagerDelegate{ @Published var lctionManager = CLLocationManager() func locationManagerDidChangeAuthorization (_ manager: CLLocationManagerDelegate){ switch man
class teste: CLLocationManager, CLLocationManagerDelegate{
@Published var lctionManager = CLLocationManager()
func locationManagerDidChangeAuthorization (_ manager: CLLocationManagerDelegate){
switch manager.authorizationStatus {
case .authorizedWhenInUse:
print("authorized")
case .denied:
print("denied")
default:
print("unkown")
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error){
print(error.localizedDescription)
}
}
locationManagerDiChangeAuthorization(实例方法“locationManagerDiChangeAuthorization”几乎与协议“locationManagerDelegate”的可选要求“locationManagerDiChangeAuthorization”匹配)和manager.authorizationStatus中的错误。authorizationStatus(类型为“CLLocationManagerDelegate”的值没有成员“authorizationStatus”)
经过一些研究,我发现这些只是IOS14,我的代码可能是用iOS13编写的(事实上,对于某些代码,我必须添加@available(IOS14.0,*))使其工作,但这次似乎不起作用)。
但是,作为一个初学者,我不知道如何更新我的代码(搜索了一些东西,但什么都没有引起我的注意)。如何更新代码?它会干扰什么吗?是否有必要编写一些东西来集成iOS 14和iOS 13?项目->信息->iOS部署目标 在这里,您可以将部署目标更改为iOS 14。