Files > ExtendedAttributes
Manage extended attributes for files and folders.
ExtendedAttributes
Manage extended attributes in Swift
Install
Add the following to Package.swift:
.package(url: "https://github.com/sindresorhus/ExtendedAttributes", from: "1.1.0")
Usage
import ExtendedAttributes
let fileURL = URL(filePath: "/path/to/file")
let data = try? fileURL.extendedAttributes.get("com.example.attribute")
You can also use it to access system-specific metadata:
import ExtendedAttributes
let fileURL = URL(filePath: "/path/to/file")
let itemCreator = try? fileURL.systemMetadata.get(kMDItemCreator as String)
API
See the documentation.
Related
- Defaults - Swifty and modern UserDefaults
- KeyboardShortcuts - Add user-customizable global keyboard shortcuts to your macOS app
- More…