Post

Replies

Boosts

Views

Activity

Comment on SwiftData with CloudKit failing to migrate schema
This solution works when you already have the app installed with V1 scheme, so the V1 database is both locally and on iCloud. But if the app was previously installed with V1 scheme and then deleted, the local DB is non existent while it still on iCloud with V1 scheme. When installing the app directly with V2 scheme, a custom migration will not be properly executed for the iCloud database. I think because the migration is executed for the local DB which is non existent. Any solution for this?
1w
Comment on SwiftData with CloudKit failing to migrate schema
Now, let's say I once had the App on my device with V1 scheme, but not anymore. So right now there is a database with V1 scheme on iCloud, but no local database on my device, right? What happens when I install the App with V2 scheme? When creating the container with iCloud sync disabled, there is no local database to migrate. And then, when creating the container with iCloud sync enabled, what happens with the iCloud database? Will it be downloaded locally and migrated to V2 or what?
1w
Comment on How can I get the safeAreaInsets in iOS 15?
How can I get the total height of statusBar + navBar + any space between these? I know that navBar height should be 44, while the sareAreaInsets.top is different from one phone to another. I get 59 for iPhone 15 and 20 for iPhone SE 3rd generation. If I get the frame.minY of a view content, the default position is 97,(6) on iPhone 15 and 64 on iPhone SE 3rd gen. This 64 value makes sense, it = safeAreaInsets.top + 44 of the navigationBar height, but I don't know where that 97,(6) comes from.
May ’24