在 Swift 中将 MKMapPoint 转换为 NSValue

Leo*_*Leo 6 casting ios swift

我想将 MKMapPoint 转换为 NSValue。在 Objective-C 中,我可以使用以下语句来做到这一点:

MKMapPoint point = MKMapPointForCoordinate(location.coordinate);
NSValue *pointValue = [NSValue value:&point withObjCType:@encode(MKMapPoint)];
Run Code Online (Sandbox Code Playgroud)

我怎样才能在斯威夫特做到这一点?谢谢!

Leo*_*Leo 0

遗憾的是,这在 Swift 中目前是不可能的。