Live data from Hacker News

SwiftData

developer.apple.com

81–90 of 109 posts

Re: SwiftData

#81
This looks interesting to me.

I have been a bit spooked on Core Data, after a friend of mine had a months-long ordeal with it; finally giving up on it, and setting up his own file-based DB.

But I do have use cases for this kind of thing.

Re: SwiftData

#82

One of the things I like about CoreData is that all the relationships and entities are defined in one file, and its easier to browse the history of that schema to see how the models evolved. One of the things I dislike though is that it doesn't interop well with swift types and almost everything has to be marked as optional. It looks like this SwiftData solves the second problem, but since definitions are spread acro…

I hope all the swift tutorials don't switch to just SwiftData, seeing as how we must support iOS(-2).

Why must you support iOS(-2)?

Re: SwiftData

#83
post #34

Earlier quoted context omitted.

They actually can figure that out, though [0]. I hope this can solve some of it because their deployment model is the dumbest fucking thing. I'm glad they figured out how to backport async/await, it's just impossible to use in a serious library otherwise. [0] https://github.com/apple/swift-evolution/blob/main/proposals...

Over 80% of iPhones are running the latest version. I’ll take that any day as a developer over the Android hellscape of versions that need to be tested for and supported. https://www.macrumors.com/2023/06/01/apple-shares-ios-16-ado...

> over the Android hellscape of versions that need to be tested for and supported.

Isn't really an issue these days. Almost everything Google puts out is in the Jetpack libraries and backported many major versions.

Re: SwiftData

#84
post #34

Earlier quoted context omitted.

Over 80% of iPhones are running the latest version. I’ll take that any day as a developer over the Android hellscape of versions that need to be tested for and supported. https://www.macrumors.com/2023/06/01/apple-shares-ios-16-ado...

Some input as an Android dev: the API level stuff is not nearly as much as a problem as it was some years ago. Nowadays you can easily require 23 or 25 (see https://apilevels.com/ ) - since 23, there were definitely some changes, but not terribly big ones that are really painful. I'm rather getting a headache with new form factors (window insets, foldables, tablets being revived). Also: Usually all google libs are ba…

As an iOS developer SwiftUI not being a library has been a huge pain, there were major bugs in point releases of iOS 13/14. It has improved a lot but there's still major headaches version to version.

Re: SwiftData

#85
post #29

Earlier quoted context omitted.

I had the same experience as you. Using CoreData with SwiftUI feels strange. Unfortunately if we start using this now we can only target iOS 17+.

Apple has like >80% of devices released in last 5 years on iOS 16. Nowhere near the fragmentation of Android. Given only a minority of users are not on the latest major OS, worrying about supporting older firmware, at least in this case, is not worth the time or money.

> Nowhere near the fragmentation of Android

This is irrelevant, though, as the hottest Android framework (Jetpack Compose) is usable on devices released 9 years ago. This is the advantage of the way Google deploys major improvements vs Apple.

Re: SwiftData

#86

This looks interesting to me. I have been a bit spooked on Core Data, after a friend of mine had a months-long ordeal with it; finally giving up on it, and setting up his own file-based DB. But I do have use cases for this kind of thing.

Core data is nice for the whole package of built in persistence and cloud sync…but can be annoying to setup

Re: SwiftData

#87
post #29

Earlier quoted context omitted.

I had the same experience as you. Using CoreData with SwiftUI feels strange. Unfortunately if we start using this now we can only target iOS 17+.

Apple has like >80% of devices released in last 5 years on iOS 16. Nowhere near the fragmentation of Android. Given only a minority of users are not on the latest major OS, worrying about supporting older firmware, at least in this case, is not worth the time or money.

If I look at our stats (banking app targeting startups), over 99% are using Android 9 or later, which is in the same ballpark.

I think for both platforms, OS fragmentation depends heavily on your target audience, moreso than the platform stereotypes.

Re: SwiftData

#88

Earlier quoted context omitted.

I hope all the swift tutorials don't switch to just SwiftData, seeing as how we must support iOS(-2).

Why must you support iOS(-2)?

Common industry practice for iOS development is to support the most recent two major versions.

Re: SwiftData

#90
Unfortunately it looks to be mostly papering over Core Data, after a few huge Core Data projects I don't really care to work with it anymore, especially in SwiftUI.

The more interesting addition to me looks to be CKSyncEngine, which would allow for easily adding a CloudKit sync engine to something like GRDB.

Defining models in structs and extending and conforming them to various protocols, using them in SwiftUI and passing them across threads feels much more natural to me.

Post reply on HN