SwiftData: externalStorage attribute on ios18

Hello,

I'm experiencing an issue with iOS 18 Beta 3 and SwiftData.

I have a model with some attributes marked as externalStorage because they are pretty large. In iOS 17 I could display a list of all my Models and it would not prefetch the externalStorage attributes. Now in iOS 18 it seems the attributes are fetched even though I don't use them in my list. It's an issue because the memory use of my app goes from 100mo on iOS 17 to more than 1gb on iOS 18 because of this. My app is configured to sync with iCloud.

Anyone else experiencing the issue?

Thanks

Gil

Yes, same here.

Related bug, calling .count on a Query's array seems to load all models, including the large items in external storage, causing a memory overflow. Calling .count on iOS 17 is fast and inexpensive.

  • Jeff
SwiftData: externalStorage attribute on ios18
 
 
Q