我可以从UIImage中获取元数据,我正在寻找一种将其添加到新UIImage中的方法
static func metadata(_ data: Data) -> [String : AnyObject]? {
let options = [kCGImageSourceShouldCache as String: kCFBooleanFalse]
if let imgSrc = CGImageSourceCreateWithData(data as CFData, options as CFDictionary), let metadata = CGImageSourceCopyPropertiesAtIndex(imgSrc, 0, options as CFDictionary) as? [String : AnyObject] {
return metadata
}
return nil
}