|
I am relatively new to iOS programming and I am having a hard time making peace between how CoreData works and what I know about software architecture. So I am trying to setup a project around the MVVM pattern with Combine framework and SwfitUI. My first problem is the The other problem is when you need to load just some of the columns out of your database table, with CoreData that means that not only you'll be arranging a rather complex database fetch operation inside your view, you'll get a dictionary result at the end, which means a whole lot of string literals for keys and type castings for values in your view code. I would normally just inject a repository into my view-model and, if required, I would return a light version of my entity from the repository with only the required columns on it. And finally, I find it problematic that all entities are Searching for a solution, I've found workarounds that basically work with Using that approach and mapping CoreData entities to immutable entities in each repository, I was able to address all the above concerns. As it stands now, I have, for instance, a At this point, I am starting to doubt whether it is worth all the effort and the overhead that CoreData brings with it, just to keep using CoreData. Why not just ditch CoreData altogether and use something like Realm instead? That looks like a bold move though, considering how integral CoreData is to iOS programming. So I wanted to know the opinion of more experienced iOS programmers. I know CoreData is a big frameworks and I am standing to lose some of its features here (like storage in iCloud which I don't need and batch loading which I could live without), but apart from those, would you call it a terribly bad idea to ditch CoreData for the reasons that I presented above. |
|
hi, i've been going back and forth on several architecture ideas when Core Data is involved in a simple (well, it was intended to be simple) project called ShoppingList15. it has a simple Core Data graph: an this project currently has 3 branches to it:
the underlying problem in all of this: bridging the gap between Core Data (object-focused) and SwiftUI (struct-focused). i am hopeful there will be some discussion on this thread. i am no expert ... i just try things out in public and hope for some useful feedback. hope that helps, DMG |
|
Core data work and software architechure have a great relation which I understand when I was developing an iOS app for Dear Lottery Result Today 1pm. Although you will also learn it with experience. But here I would like to give you an advice. Whenever you see any issue so try to search about that issue on youtube and you will get solution. |
|
GO FURTHER, FASTER Unleash your full potential as a Swift developer with the all-new Swift Career Accelerator: the most comprehensive, career-transforming learning resource ever created for iOS development. Whether you’re just starting out, looking to land your first job, or aiming to become a lead developer, this program offers everything you need to level up – from mastering Swift’s latest features to conquering interview questions and building robust portfolios.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.