I have implemented CLLocationManagerDelegate in my viewcontroller and I am getting the following warnings
Parameters of 'locationManager(_:didUpdateLocations:)' have different optionality than expected by protocol 'CLLocationManagerDelegate'
Parameters of 'locationManager(_:didFailWithError:)' have different optionality than expected by protocol 'CLLocationManagerDelegate'
Parameter of 'locationManager(_:didChangeAuthorizationStatus:)' has different optionality than expected by protocol 'CLLocationManagerDelegate'
From this what I understood " Optionality of parameters(whether the variable is optional or not) is different from what is there in original protocol method definition "
But I couldn't find any difference between the original and what I have with me.
Here it is
In Protocol definition
optional public func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
optional public func locationManager(manager: CLLocationManager, didFailWithError error: NSError)
optional public func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus)
In my implementation of the protocol
func locationManager(manager: CLLocationManager,
didUpdateLocations locations: [CLLocation])
func locationManager(manager: CLLocationManager,
didFailWithError error: NSError)
func locationManager(manager: CLLocationManager,
didChangeAuthorizationStatus status: CLAuthorizationStatus)
My xcode version is 7.1.1
So can anybody explain me why the warnings are popping up ?
Restarting the xcode solved the problem...sometimes things are strange
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With