Weekends are awesome. I don’t get up super early and most of the time get an opportunity to work on personal projects, read up on new advances in Swift, catch up on news, etc.
Today I needed to migrate my Core Data model to a new version. Fortunately for me, light weight migration was enough and I didn’t have to perform the migration using a Mapping Model. Renaming attributes however is a bit more involved than simply adding attributes. This, of course, meant I would have something to write about… although, admittedly, I had another topic in mind for this week’s article.
Light weight migrations are pretty straight forward; Core Data takes care of everything by inferring mapping model from differences between the source and destination models.
Continue reading “Core Data – Renaming Attributes”
My latest app, in.notes, uses Core Data for persisting notes to the file system. While the setup is relatively simple and could have been implemented in a number of ways, including archiving, using Core Data however, was the right decision for many reasons.
As I am going through each class, rewriting the app in Swift, the time has come to research Core Data piece. Since I had a couple of hours to spare today, that’s exactly what I did.
Continue reading “Simple Core Data in Swift”
I’ve spent the last few weeks in the “basement” of my house developing my next project – Slync app. While the process was very interesting and challenging at the same time, it is always worth it. I should probably write about that experience in my next post.
During that time, I started diving into Core Data in greater detail. Specifically, keeping local store and the remote database in sync (which can be a bit tricky).
Let me start by saying that Core Data evolved greatly over the past few years. This year, at WWDC Apple engineers talked about great improvements to the Core Data and iCloud integration worth learning about (WWDC videos) and some other great improvements. Nevertheless, the whole boilerplate code to insert objects into the store or fetching them from the store into the memory is still a bit tedious. This makes me think of an episode from Friends where Joey took part in commercials advertising milk cartons openers. “There’s got to be a better way…” – he said after spilling milk by trying so to open a milk carton. That’s exactly what I thought when I started integrating Core Data into my project.
Continue reading “Thoughts on MagicalRecord Wrapper Library for CoreData”