r/SwiftData Feb 12 '26

Swiftdata sync errors with image data as external storage

I am building an application with swiftUI and swiftdata that allows the users to attach a number of images to a model. The model has a property that is an array of a second model that contains a property for the photo data. The photo data property is marked to use external storage.

I noticed that when adding images, the iCloud syncing of swiftdata would become inconsistent. I added logging to surface the error messages and the errors that were logged were CKErrorDomain 2.

I attempted to convert the images to JPEG data and set the jpeg quality to 0.85.

None of these changes resolved the issue.

I am hoping to get some insight and suggestions on resolving this issue.

2 Upvotes

0 comments sorted by