Id like to know what db/storage/persistence is used now in the industry.
What would be a good db to start since I am new in IOS development.
I have been an Android Developer for a long time so I ve been accustomed with SQLite.
I have been reading about Core Data, Realm, SQLite as possible start.
I suggest go with Core Data since you are new in iOS Development.
As a developer new in iOS, I suggest stick to the core / native approaches first before exploring 3rd party solutions.
Trying Core Data earlier today but it seemed not to be too beginner friendly, I think.
I started a project using a tutorial i followed in apple but apparently Core Data was not initially set up, so I went to stack overflow and now following how to add Core Data to the project and im a bit lost in it.
Learn the basics of building the data layer of your iOS app in this getting started with Core Data tutorial!
Core Data uses SQLite as its persistent store by default. It’s also built-in to the iOS SDK so most projects use it.
If you don’t mind having an external dependency and managing it (via cocoapods), I think Realm and Firebase are great with a simpler API.
Im actually trying Core Data, and the link you mentioned would work if I am working from scratch.
Unfortunately, I want to continue what I’ve started and i am trying to add Core Data to an existing project and I am stuck because I still lack the mastery to fully comprehend all the instruction on the link i gave.
Hi, if you are starting a new project with Core Data, I encourage you to use an existing wrapper library to help you avoid common pitfalls.
@john.estropia thanks for the recommendation. Id like to understand and learn how the “old way” first in order to understand IOS better.
Ive booked marked the link you ve given me so I can read it and use it on future projects.
No problem. That’s a good mindset.
CoreStore is just a layer on top of CoreData, so you can always use it with your existing models anytime you feel comfortable.
Regardless, feel free to ask anything anytime. Goodluck!
If you want to understand old school Core Data stack, here’s a good intro describing all the components.
A lot of the code in the old core data stack is boilerplate since most of it is for setting-up the stack. You’ll most likely work with NSManagedObject and NSManagedObjectContext most of the time in code, and the data model file for creating models and relationships.
Once, you’ve understood that, NSPersistentContainer is a new API in iOS 10 and encapsulates a lot of the boilerplate.
Core Store is seriously impressive. This is probable the most comprehensive Core Data swift wrapper I’ve seen. Even includes wrappers for migrations! Great job on this. Will consider it using it on new projects if I ever go back to Core Data.
Hi @MacadamiaPH Thanks for posting questions. Just wanted to ask that you mark which reply solved your problem or which one is the most useful to you. This will be helpful to the community and visitors of the thread.
Thanks. Ill keep that in mind.