0
エラーを起こさずに次の操作を行うにはどうすればよいですか?ラインlocationManager.delegate = self
は、私は、デリゲートがlocationManager
財産がその一部となっているクラスのインスタンスになりたいことがCannot assign value of type '(APPLocationManager) ->() -> (APPLocationManager)' to type 'CLLocationManagerDelegate?'
CLLocationManagerを作成するときにCLLocationManagerデリゲートを割り当てる
let locationManager: CLLocationManager = {
let locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.activityType = CLActivityType.other
locationManager.allowsBackgroundLocationUpdates = true
locationManager.pausesLocationUpdatesAutomatically = true
locationManager.distanceFilter = APPLocationManagerDistanceFilter
return locationManager
}()
できないと言います。
最初の行に。 letをlazy varに変更する – Honey