This is not the most coherent post... mostly wanted to start a discussion about persistence and the future of CoreData, especially in the context of SwiftUI.
This has probably been the most exciting year for me since the initial release of Swift. When SwiftUI was announced at WWDC I literally screamed for a minute out of sheer joy and excitement. Adding on top of SwiftUI Apple releasing great frameworks like Combine, CryptoKit and adding support for websockets, Swift and iOS development has never been better!
Apple, already having pushed for the use of structs (when possible and applicable) over classes as default type for eg models, have really emphasized the need for structs in SwiftUI. In order for UI to update, models needs to be structs. And for ease of use with
List (replacement of
UITableView for those of you who haven’t begun the SwiftUI transition), our structs should conform to Swift 5.1 new protocol
How does CoreData fit into this new patterns? It doesn’t. We need to manually code support for conversion between structs and classes. Which for nested types become tedious.
Yes sure the are many third party libraries working with structs conforming to Codable. But since Apple recently released their own library for reactive programming (Combine) and updated crypto methods releasing it as a new own framework (CryptoKit) and themselves support Websockets etc, and since CoreData already exists (built on top of SQLLite?) it feels like it would make sense for Apple to make it easy to support persistence in our SwiftUI apps?
What do you think?