Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let fileManager = FileManager.default
- guard fileManager.fileExists(atPath: path) else { print("File doesn't exists"); return }
- do {
- let attributes = try fileManager.attributesOfItem(atPath: path)
- guard let extendedAttributes = attributes[FileAttributeKey(rawValue: "NSFileExtendedAttributes")] as? [String: Any] else { return }
- guard let data = extendedAttributes["com.apple.metadata:kMDItemWhereFroms"] as? Data else { return }
- let urls = try PropertyListDecoder().decode([String].self, from: data)
- print(urls)
- } catch {
- print("Error: \(error)")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement