Skip to content

polykv/polykv-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PolyKV - Swift

Swift Version License Stars Platform

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.

✨ Why PolyKV Swift?

  • 🍎 Apple Native Built directly on top of UserDefaults and FileManager. 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.

📦 Installation

Swift Package Manager (SPM)

Add this to your Package.swift:

dependencies: [
    .package(url: "https://github.com/your-username/polykv.git", from: "1.0.0")
]

🚀 Usage

Complete Async Example

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()
}

🌍 Platform Support

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.

📜 License

MIT

About

Zero-Config, Native Key-Value Store for Swift

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages