Argus
Argus

Reputation: 2339

How to Convert NSValue to CLLocationCoordinate2D

How to convert NSValue to CLLocationCoordinate2D?

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

Upvotes: 1

Views: 469

Answers (1)

Argus
Argus

Reputation: 2339

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

Upvotes: 3

Related Questions