UICollectionView & Core Data

Good news! I’ve started on my first real app, which I’m hoping to submit to the App Store prior to my birthday in July. The app makes heavy use of a UICollectionView, which can be really cool and also super frustrating. I discovered very quickly that UICollectionView and NSFetchedResultsController do NOT play nice together. Perhaps Apple didn’t anticipate people wanting using Core Data to populate collection views, or they don’t want to take the time to change the API…either way, it presents an interesting problem––one that has received over 1500 views  (and I think only like 400 of those are me!).

Since I’ve decided to use Swift for my app, I was hoping for a slightly simpler solution than the answer on that Stack Overflow page, which involves keeping track of each and every change as an NSDictionary inside an NSArray. Fortunately, I found a solution at the very bottom of this thread that did the trick. It’s already in Swift, too, which is a major plus (though I am getting pretty good at translating Obj C to Swift).

Now I’ve run into a problem with the method I’m using to delete multiple selected items from the UICollectionView. However, I think I know what I did wrong, so hopefully I can get that fixed tomorrow and be on my way!