After being stuck for so many days on my #CoreData migration, finally being able to move on feels so nice! :blobcheer:
I habe to use a workaround, but thats fine. Time to finish that update!
Thanks to Peter Hauke for taking a deep look into my issue and all the others being so helpful!
To the #Swift experts:
How do I have to handle #CoreData fetch requests in #AppIntents Shortcuts?
For some reason my code crashes whenever the app is running in background. Once the app is closed, my fetch works fine … :thonkpad:
I just submitted #SwiftData feedback FB12436124 that it would be great if relationship insert/deletes would trigger view redraws. This was not something we had in #CoreData, and it is painful. For example if you add a new employee to department.employee, this won't trigger a redraw on ForEach(department.employees) {...}.
It looks like #SwiftData doesn't support constraints with multiple attributes, unlike #CoreData. With CoreData you can enforce uniqueness for "firstName,lastName" where only entities with the same value for BOTH attributes would flag as duplicates. This is obviously valuable, and seems to be lost with @Attribute(.unique). Filed as feedback FB12385087.
Playing with #CoreData.
It’s… OK. I realize it’s very old now (2005, and really based on EOF from 1994), but Apple needs to either modernize it or replace it.
A bit like LINQ, it has its own custom query syntax, but with far less compile-time help. Play with Entity Framework (basically an ORM based on LINQ) for a day, and you’ll be like “…oh”.
More work on my app.
Been trying to set it up so #CoreData objects can be created and updated from the objects sent from the API using the #Codable protocol.
It has had its headaches but I got it mostly set up, even to the point of updating existing objects in the data store.
My issue comes when I hit a collection of objects. I’m not sure how to handle inside of the init(from: Decoder) when some or all of those objects are already in my store
Yesterday I spent a little time to learn more about #CoreData and CloudKit, which seems to be working now. So all the data recorded with macOS or iOS will always stay synchronized, which I tested yesterday on our night out. Even tho we weren’t at home, we were getting live data of #Karlssons mood.