Can I use the Unique macro with CloudKit?

Asked on 04/11/2025

1 search

The Unique macro is a feature of SwiftData, not CloudKit. It allows you to define unique constraints on your model's properties to ensure that certain combinations of properties remain unique within your data model. This is useful for avoiding duplicates and managing data integrity within your app's local data storage. For more details, you can refer to the session What’s new in SwiftData at the timestamp 02:43.