Is it possible to convert a string to a longitude/latitude value? I managed to convert the coordinate to a string, but I cannot find a way to revert the process
Another way to convert:
let latitude = (latitudeString as NSString).doubleValue
let longitude = (longitudeString as NSString).doubleValue
Swift 3
let lat = Double(String1)
let lon = Double(String2)
let coordinates = CLLocationCoordinate2D(latitude:lat!
, longitude:lon!)
CLLocationCoordinate2D
is a double value it can convert string into double See in above example
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