网上找了很多都没有找到swift版本能用的,我参考了网上现有的知识点 然后在官方文档里一个个查阅总结一下。
func writeMetaData(imageData: Data) -> Data? {
let options = [kCGImageSourceShouldCache : kCFBooleanTrue]
if let imgSrc = CGImageSourceCreateWithData(imageData as CFData, options as CFDictionary) {
let metadatacc = CFDictionaryCreateMutableCopy(nil