Native, Modern Key-Value Store for iOS & macOS.
A focused, Swift-native wrapper for Apple's UserDefaults (and filesystem). PolyKV brings a unified API to your Apple ecosystem apps, making cross-platform logic sharing a breeze.
One API, Everywhere. This library is part of the PolyKV ecosystem. Use the same consistent API across 12+ languages.
-
🍎 Apple Native Built directly on top of
UserDefaultsandFileManager. Zero external dependencies. -
🧵 Structured Concurrency Designed for Swift's modern concurrency model. No more completion handler hell.
-
🛡 Sandboxed by Default Automatically respects Apple's App Sandbox rules, so your data is stored securely and compliantly.
Add this to your Package.swift:
dependencies: [
.package(url: "https://github.com/your-username/polykv.git", from: "1.0.0")
]import PolyKV
Task {
let kv = PolyKV("MyApp")
// 1. Save
await kv.setString("username", "john_doe")
await kv.setBool("notifications", true)
await kv.setMap("flags", ["beta": true])
// 2. Read
if let user = await kv.getString("username") {
print("User: \(user)")
}
// 3. Update
await kv.setBool("notifications", false)
// 4. Delete
await kv.remove("flags")
// 5. Clear All
await kv.clear()
}| Language | Verified Runtime (✅) | Build Only (🛠) |
|---|---|---|
| TypeScript | CLI (Node.js), Browser, React Native (iOS/Android) | - |
| Dart | Flutter (iOS/Android/macOS), CLI | - |
| Go | macOS, Linux, Windows, iOS, Android, CLI | - |
| Rust | macOS, iOS, Android, CLI | Linux, Windows |
| Swift | iOS, macOS, CLI | - |
| C++ | macOS, iOS, Android, CLI | - |
| Python | CLI, Web, Android | - |
| Kotlin | CLI, Web, Android | - |
| C# | CLI | Android, Windows |
| Java | CLI, Android | - |
| Ruby | CLI | - |
| PHP | CLI | - |
✅ Runtime Verified: Full CRUD operations verified via automated tests on actual devices/simulators.
MIT