All posts filed under “Core Data

comment 0

#35 Structs Alternative: Using Swift Protocols to Enhance Safety of Core Data Access

A previous article mentions the usage of a structs layer in accessing Core Data. This approach has some very nice properties, like thread safety of the struct values and the structs are always well formed. However this approach became too bothersome in our code and had its own share of problems. To create a struct layer you have to implement…

comment 0

#28 Better CoreData with Swift Generics

In Issue #25 I have been talking about building a modern CoreData service using NSPersistentStoreContainer. This resulted in a lot of boilerplate code removed and a simpler API. Now, if you are using architectures like VIPER, VIP (see more in Issue #24) or simply ensuring immutability of your models, you are probably wrapping your CoreData's NSManagedObject subclasses into structs of…

comments 5

#25 Core Data in iOS10: NSPersistentContainer

Xcode 8 is here if you have not peeked at any of betas yet, you will find all kinds of new stuff. There is Swift 3 with major changes, there are new frameworks like SiriKit and there are enhancements to existing ones like notifications. We have also received simplified Core Data stack in form of NSPersistentContainer that does heavy part…