尝试使用 Phasset 从 UIImage 添加位置:
// image is a variable like so: image: UIImage
var newAsset = PHAssetChangeRequest.creationRequestForAssetFromImage(image)
newAsset.location = CLLocation(latitude: coordinate.latitude, coordinate.longitude)
这段代码显然有效 - >将新资产保存到具有良好坐标的照片库中。我可以在图书馆本身看到它。
但是当我使用 exif 工具和类似工具时,大多数时候,GPS 字典是空的,就好像没有设置位置一样。(另外,我注意到 GPS 信息不是 exif 格式)所以我猜,位置信息也在其他地方......
那么 PHAsset 的 location 属性有什么问题?如何正确设置位置?