Live data from Hacker News

SwiftData

developer.apple.com

31–40 of 109 posts

Re: SwiftData

#31
post #23
post #22

I built myself something similar on top of SQLite and Combine. Now I’m confused, should I abandon it and go with the first hand solution? I would actually prefer that but this requires the new versions of the Apple platforms. Why wouldn’t Apple make these available downstream?

> Why wouldn’t Apple make these available downstream? Because Apple cannot figure out that their deployment model is hamstringing adoption of their technologies.

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...

Re: SwiftData

#32
post #22

I built myself something similar on top of SQLite and Combine. Now I’m confused, should I abandon it and go with the first hand solution? I would actually prefer that but this requires the new versions of the Apple platforms. Why wouldn’t Apple make these available downstream?

Apple actively encourages everyone to adopt the latest version. If your device is from 2018 or newer it will support the latest OS, so back porting frameworks is less important than on platforms like Android where devices are only updated for a much shorter duration and often several months after that version is released by Google.

Re: SwiftData

#33

I’m actually really looking forward to this. I tried building a few apps in 100% SwiftUI coming from React/Node.js and it was a pretty major pain. I also don’t know UIKit so I couldn't easily fallback.

Try it with ChatGPT. I've never built an iOS app and it took me 5 minutes to get a SwiftUI app running with gpt-4.

Re: SwiftData

#34
post #23

Earlier quoted context omitted.

> Why wouldn’t Apple make these available downstream? Because Apple cannot figure out that their deployment model is hamstringing adoption of their technologies.

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...

Re: SwiftData

#35

I’m actually really looking forward to this. I tried building a few apps in 100% SwiftUI coming from React/Node.js and it was a pretty major pain. I also don’t know UIKit so I couldn't easily fallback.

Try it with ChatGPT. I've never built an iOS app and it took me 5 minutes to get a SwiftUI app running with gpt-4.

A basic app or one you created a bunch of custom logic, cloud sync integration, etc? I can build a simple app in a minute or two.

Re: SwiftData

#36

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…

You still have the option to keep things organized, though you will need to supply a bit more of your own discipline.

Re: SwiftData

#37
post #29

I’m actually really looking forward to this. I tried building a few apps in 100% SwiftUI coming from React/Node.js and it was a pretty major pain. I also don’t know UIKit so I couldn't easily fallback.

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.

Re: SwiftData

#38

Earlier quoted context omitted.

Try it with ChatGPT. I've never built an iOS app and it took me 5 minutes to get a SwiftUI app running with gpt-4.

A basic app or one you created a bunch of custom logic, cloud sync integration, etc? I can build a simple app in a minute or two.

Yes, custom logic and cloud sync.

It tracks sprint workouts with GPS / pedometer. It's not Uber, but it's a good bit beyond a hello world.

Re: SwiftData

#39
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.

I know, but even with my small app I don't feel comfortable dropping support for the 20% users who are behind. And if I'm supposed to maintain both the old and the new API in parallel then why bother.

Now for new apps I can see going all in with the latest SDKs.

Re: SwiftData

#40
post #21

It’d be interesting to see a performance comparison of SwiftData vs. (objc?) CoreData vs. plain XML for large datasets. I recall plain XMLs being faster than CoreData a few years ago in certain scenarios.

It is a good addition. CoreData, is ok, but is not really used from serous apps. At least, none of the large ones that I have worked on. Either use flat files (serialized json) to save and restore state, or just Sqlite directly.

Super interested to understand more of this - I've worked on lots of serious apps, but not more than the scale of "banking app with ~1m users and 6 iOS devs"
Post reply on HN