在iOS8上,当使用照片应用程序时,你可以在查看每一张特定照片时看到位置标题。例如“家”或“中央公园”--我如何从PHAsset或类似的类中获取数据/字符串?
我在PHAsset类中没有看到localizedTitle或类似的属性。
谢谢。
发布于 2016-03-22 22:20:15
您应该从PHAsset的相应属性中获取资源坐标。然后通过CLGeocoder获取位置信息。例如。
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:asset.location
completionHandler:^(NSArray<CLPlacemark *> * _Nullable placemarks, NSError * _Nullable error) {
CLPlacemark *placemark = [placemarks firstObject];
NSLog(@"%@", placemark.name);
}];别忘了导入CoreLocation框架。
发布于 2015-08-17 15:22:21
PHAsset有一个名为creationDate的属性,您可以使用someAsset.creationDate获取日期
https://stackoverflow.com/questions/26623612
复制相似问题