What's New

Modernized for SwiftPM and iOS 17

2026-07-05T21:51:09Z

Breaking

  • Minimum deployment target raised to iOS 17 / tvOS 17 / watchOS 10 (previously iOS 11 / tvOS 11 / watchOS 9). Requires Swift 5.9+ / Xcode 15+ to build.
  • CocoaPods support removed. Zephyr.podspec is gone; Swift Package Manager is now the only supported installation method.

Fixed

  • Zephyr.setUserDefaultsSuite(to:) now migrates all registered KVO observers to the new suite on the internal sync queue. Previously the suite was swapped without re-registering observers, so changes in the new suite were never monitored.
  • Cloud-to-local syncs now write all values on the main queue and re-register observers on the sync queue only after the writes complete, closing a race where a KVO callback could fire mid-sync and echo stale values back to iCloud.
  • .keysDidChangeOnCloud is now posted once per cloud sync, after the local writes finish, instead of firing per-key and again at the end.
  • observeValue(forKeyPath:) checks the monitored-key set on the sync queue rather than the caller's thread, and registerObserver(key:) refuses keys that are not currently monitored, so stale observers can no longer trigger syncs for unmonitored keys.
  • sync(keys: []) with an empty array now falls back to a full sync, matching the documented behavior of the variadic overload.

Housekeeping

  • Removed #available checks made obsolete by the new deployment targets.
  • Removed the CocoaPods/bundler toolchain (Gemfile, Gemfile.lock, .bundle).
  • README updated for Swift 5.9, the new platform minimums, and SPM-only installation.

See #73 for full details.

Zephyr 🌬️

Effortlessly sync UserDefaults over iCloud

Swift Support Platforms SwiftPM Compatible


About

Zephyr synchronizes specific keys and/or all of your UserDefaults 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.

Features

  • Swift Package Manager Support
  • Syncs specific UserDefaults keys or all of your UserDefaults.
  • Background monitoring and synchronization between UserDefaults and NSUbiquitousKeyValueStore
  • Detailed Logging

Installation

Zephyr supports Swift 5.9+, iOS 17.0+, tvOS 17.0+, and watchOS 10.0+.

Swift Package Manager

.package(url: "https://github.com/ArtSabintsev/Zephyr.git", from: "4.0.0")

Manual

  1. Download Zephyr
  2. Copy Zephyr.swift into your project.

Setup

Turn on iCloud Sync in Xcode

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)

How to turn on iCloud Key Value Store Syncing

Integrate Zephyr into your App

Before performing each sync, Zephyr automatically checks to see if the data in UserDefaults or NSUbiquitousKeyValueStore is newer. To make sure there's no overwriting going on in a fresh installation of your app on a new device that's connected to the same iCloud account, make sure that your UserDefaults are registered BEFORE calling any of the Zephyr methods. One way to easily achieve this is by using the UserDefaults Register API.

Sync all UserDefaults

Zephyr.sync()

Sync a specific key or keys (Variadic Option)

Zephyr.sync(keys: "MyFirstKey", "MySecondKey", ...)

Sync a specific key or keys (Array Option)

Zephyr.sync(keys: ["MyFirstKey", "MySecondKey"])

Add/Remove Keys for Background Monitoring (Variadic Option)

Zephyr.addKeysToBeMonitored(keys: "MyFirstKey", "MySecondKey", ...)
Zephyr.removeKeysFromBeingMonitored(keys: "MyFirstKey", "MySecondKey", ...)

Add/Remove Keys for Background Monitoring (Array Option)

Zephyr.addKeysToBeMonitored(keys: ["MyFirstKey", "MySecondKey"])
Zephyr.removeKeysFromBeingMonitored(keys: ["MyFirstKey", "MySecondKey"])

Toggle Automatic Calling of NSUbiquitousKeyValueStore's Synchronization method

Zephyr.syncUbiquitousKeyValueStoreOnChange = true // Default
Zephyr.syncUbiquitousKeyValueStoreOnChange = false // Turns off instantaneous synchronization

Debug Logging

Zephyr.debugEnabled = true // Must be called before sync(_:)
Zephyr.sync()

Use a specific UserDefaults suite

if let suite = UserDefaults(suiteName: "group.com.example.app-name") {
  Zephyr.setUserDefaultsSuite(to: suite)
}

Created and maintained by

Arthur Ariel Sabintsev

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Jul 18 2026 18:12:35 GMT-0900 (Hawaii-Aleutian Daylight Time)