This component provides an elegant and functional view to display the iCloud synchronization status in iOS applications using SwiftData or CoreData with iCloud sync.
- Displays the current sync status (Unknown, Syncing, Synced, Error)
- Automatically updates based on
NSPersistentCloudKitContainernotifications - Modern and easily customizable design
- SwiftUI compatible
- Works with both SwiftData and CoreData
- Add the
CloudSyncStatusView.swiftfile to your Xcode project. - Ensure your project has iCloud and CloudKit capabilities enabled.
import SwiftUI
struct ContentView: View {
@StateObject private var cloudKitSyncMonitor = CloudKitSyncMonitor()
var body: some View {
VStack {
CloudSyncStatusView(syncMonitor: cloudKitSyncMonitor)
}
}
}You can easily customize the appearance of the view by modifying the styles in the CloudSyncStatusView struct.
iCloud Syncing Status
iCloud Sync Status

Contributions are welcome. Please open an issue or submit a pull request to suggest changes or improvements.