https://github.com/0xwdg/icloudstorage
iCloudStorage is a property wrapper around NSUbiquitousKeyValueStore to easily access your shared UserDefaults.
https://github.com/0xwdg/icloudstorage
0xwdg icloud key-value-store nsubiquitouskeyvaluestore propertywrapper swift swiftui
Last synced: about 2 months ago
JSON representation
iCloudStorage is a property wrapper around NSUbiquitousKeyValueStore to easily access your shared UserDefaults.
- Host: GitHub
- URL: https://github.com/0xwdg/icloudstorage
- Owner: 0xWDG
- License: mit
- Created: 2025-01-24T14:45:16.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-13T18:37:55.000Z (3 months ago)
- Last Synced: 2025-04-16T02:09:23.036Z (2 months ago)
- Topics: 0xwdg, icloud, key-value-store, nsubiquitouskeyvaluestore, propertywrapper, swift, swiftui
- Language: Swift
- Homepage: https://0xwdg.github.io/iCloudStorage/
- Size: 300 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# iCloudStorage
iCloudStorage is a property wrapper around NSUbiquitousKeyValueStore to easily access your shared UserDefaults.
[](https://swiftpackageindex.com/0xWDG/iCloudStorage)
[](https://swiftpackageindex.com/0xWDG/iCloudStorage)
[](https://swift.org/package-manager)
## Requirements
- Swift 5.9+ (Xcode 15+)
- iOS 13+, macOS 10.15+## Installation (Pakage.swift)
```swift
dependencies: [
.package(url: "https://github.com/0xWDG/iCloudStorage.git", branch: "main"),
],
targets: [
.target(name: "MyTarget", dependencies: [
.product(name: "iCloudStorage", package: "iCloudStorage"),
]),
]
```## Installation (Xcode)
1. In Xcode, open your project and navigate to **File** โ **Swift Packages** โ **Add Package Dependency...**
2. Paste the repository URL (`https://github.com/0xWDG/iCloudStorage`) and click **Next**.
3. Click **Finish**.## Usage
```swift
import SwiftUI
import iCloudStoragestruct ContentView: View {
@iCloudStorage("key")
var value: String = "default"var body: some View {
VStack {
Text(value)Button("Change value") {
value = "Hello there at \(Date())"
}
}
.task {
value = "Hello there"
}
.padding()
}
}
```## Contact
๐ฆ [@0xWDG](https://bsky.app/profile/0xWDG.bsky.social)
๐ [mastodon.social/@0xWDG](https://mastodon.social/@0xWDG)
๐ฆ [@0xWDG](https://x.com/0xWDG)
๐งต [@0xWDG](https://www.threads.net/@0xWDG)
๐ [wesleydegroot.nl](https://wesleydegroot.nl)
๐ค [Discord](https://discordapp.com/users/918438083861573692)Interested learning more about Swift? [Check out my blog](https://wesleydegroot.nl/blog/).