#Michael L. Kral
####Call: (602)799-9961 ####Email: [email protected]
##Experience
| // This gist demonstrates how you can implement versioning for a Codable struct to support loading | |
| // old serialized data after changing the structure. Notable features of this solution: | |
| // | |
| // * No need to make new properties optional, or to perform post-processing on the struct after | |
| // loading in ordeer to populate missing values | |
| // * No need to change the call site - from the outside this struct behaves just the same | |
| // as if we had implemented codable directly in the normal way. | |
| // * Versioning can be applied individually to parents or leaves in a larger tree of | |
| // structs without affecting the other elements | |
| // * This approach will work even if the original struct was not designed with versioning in mind |
| // | |
| // MagicalRecord + Seam bridge | |
| // | |
| #import "MagicalRecord+SeamStore.h" | |
| @import Seam; | |
| @implementation NSPersistentStoreCoordinator (SeamStore) |
#Michael L. Kral
####Call: (602)799-9961 ####Email: [email protected]
##Experience