Given that the code
var latitude = userLocation.coordinate.latitude
returns a CLLocationDegrees Object, how can I store the value in to a variable so that I can apply it as the text of a label.
I can print the variable to the console without any issues but obviously that doesn't help me too much!
Looking through the valuable options through the autocomplete i see there is a description;
var latitude = userLocation.coordinate.latitude.description
But this is returning me null?
Thanks
since CLLocationDegrees is just a typedef for Double, you can easily assign it to a string var, ie:
var latitudeText:String = "\(userLocation.coordinate.latitude)"
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