Zephyr synchronizes specific keys and/or all of your NSUserDefaults over iCloud using NSUbiquitousKeyValueStore.
Zephyr has built in monitoring, allowing it to sync specific keys in the background as they change.
For the latest updates, refer to the Releases tab.
- CocoaPods Support
- Syncs all your NSUserDefaults (if you wish)
- Syncs only specific keys in NSUserDefaults
- Background monitoring and synchronization between NSUserDefaults and NSUbiquitousKeyValueStore
- Detailed Logging
pod 'Zephyr'
- Add
import Zephyr
to any.Swift
file that references Zephyr via a CocoaPods installation.
- Download Zephyr
- Copy
Zephyr.swift
into your project.
In Xcode, open your app's project/workspace file:
- Click on your Project
- Click on one of your Targets
- Click on Capabilities
- Turn on iCloud syncing
- Under Services, make sure to check
Key-value storage
- Repeat for all Targets (if necessary)
Before performing each sync, Zephyr automatically checks to see if the data in NSUserDefaults or NSUbiquitousKeyValueStore is newer.
Sync all NSUserDefaults
Zephyr.sync()
Sync a specific key or keys (Variadic Option)
Zephyr.sync("MyFirstKey", "MySecondKey", ...)
Sync a specific key or keys (Array Option)
Zephyr.sync(["MyFirstKey", "MySecondKey"])
Add/Remove Keys for Background Monitoring (Variadic Option)
Zephyr.addKeysToBeMonitored("MyFirstKey", "MySecondKey", ...)
Zephyr.removeKeysFromBeingMonitored("MyFirstKey", "MySecondKey", ...)
Add/Remove Keys for Background Monitoring (Array Option)
Zephyr.addKeysToBeMonitored(["MyFirstKey", "MySecondKey"])
Zephyr.removeKeysFromBeingMonitored(["MyFirstKey", "MySecondKey"])
Debug Logging
Zephyr.debugEnabled = true // Must be called before sync(_:)
Zephyr.sync()