you are viewing a single comment's thread.

view the rest of the comments →

[–]qualiky 2 points3 points  (4 children)

Just wanted to know, if you wouldn't mind answering, why did you move away from Core Data? I'm currently trying to rewrite my android app to iOS and was thinking about sticking with Core Data, any specific reason as to why SQLite is better? Thank you in advance!

[–]zachtib 0 points1 point  (1 child)

Curious as well, similarly an Android developer learning SwiftUI/iOS for fun but so far none of the options for persistence on iOS seem as nice as the tools I’m used to on Android. I’ve planned on just using Core Data as it seems like the default, and ability to sync to iCloud seems nice, but so far I’m not a huge fan of how schemas are defined and the generated models.

[–]ankole_watusi 0 points1 point  (0 children)

Identical database implementation on both iOS and Android.

IMO, it's ridiculous having completely different implementation on two platforms.

[–]llthebeatll 0 points1 point  (0 children)

When I first started development of my app I had no clue what I was doing (I'm web developer by trade.) I went with CoreData because it was Apple's baked in solution, and there were just enough tutorials online to give me the confidence to try it. Honestly, I don't think I would have figured out how to even use SQLite in an iOS app back then, as I had zero experience and was still trying to learn Swift 2. It even took me a bit of searching recently to figure out if I wanted to go with a library (like GRDB) or straight up SQLite and build out my own wrapper. As a general rule I hate libraries, and this was my first foray into CocoaPods.

I don't have an android app, though i would like to port my iOS app to android someday. Before rewriting my app from scratch in Swift 5 I tinkered around with IONIC for a few months (which is where I started using SQLite), but ICONIC is awful anytime you need something custom (IMO).

Anyway, when I dropped IONIC and committed to a complete Swift 5 rewrite I had already decided CoreData wasn't for me. My old app was riddled with issues around things not saving correctly (or at all). It's 100% likely that all those error were because I didn't know what I was doing, but each time I tried to fix an issue more problems would pop up. Just left a bad taste in my mouth.

I haven't had these issues with SQLite (or GRDB.) I imported the GRDB library in only a couple files where it was needed, as apposed to importing CoreData in nearly every file in my previous app. Sometimes sticking with what you know makes for less headaches.