How to Convert NSValue to CLLocationCoordinate2D

466 Views Asked by At

How to convert NSValue to CLLocationCoordinate2D?

I receive NSValue in (NSArray *)coordinateArray and need to get CLLocationCoordinate2D for each NSValue in array.

1

There are 1 best solutions below

0
On BEST ANSWER

Obj-C

#import <MapKit/MKGeometry.h> 

NSValue *coordinateValue; 
CLLocationCoordinate2D coordinate = [coordinateValue MKCoordinateValue];

Swift 4.x

let coordinateValue: NSValue = NSValue.init()
let coordinate: CLLocationCoordinate2D = coordinateValue.mkCoordinateValue