I am working on a SwiftUI application that needs to sync data across multiple devices using CloudKit. I am trying to decide between two options:
- CKSyncEngine with a custom model
- SwiftData plus CloudKit container.
This decision is crucial for me because the application I am developing is using tree structured data and the relationship between the data is very complex. I would appreciate your guidance on which option is better suited for my needs.
One of the benefits of using SwiftData is that it has a lot of interesting features that can save me a lot of development time, such as automatic migrations, batch operations, predicates, sorting, grouping, etc. However, one of the drawbacks is that it may not be flexible enough to handle the complex data display logic that I need for my application. For example, I need to show different views depending on the level and type of the tree nodes, and I also need to perform some calculations and transformations on the data before displaying it. I am afraid that using SwiftData will lead to more complexity and uncertainty when implementing these features, and there may be performance issues as well.
Another factor that I need to consider is the future support and development of these options. I believe SwiftData will have a good future because it is based on Apple's frameworks and technologies. However, I don't know if CKSyncEngine will be valued in the long run because it is a third-party framework that may not be updated or maintained regularly.
In conclusion, I am still unsure whether to use CKSyncEngine or SwiftData for my SwiftUI application that needs CloudKit sync. Both options have their pros and cons, and I need to weigh them carefully according to my requirements and preferences. I would love to hear your opinion on this matter.
Thank you for your time and attention.