tundsdev 💫 · @tundsdev
873 followers · 424 posts · Server iosdev.space

SwiftUI's new Preview macro & SwiftData can be a match made in heaven, but only if you know how to use it...

In this video, we'll be looking at just that:

👀 Building A Container For Previews
🤲Prefilling Previews
⚡️Building Our Own Previews Component

📹linktw.in/dW7g9X

#swiftdata #swiftui

Last updated 1 year ago

Michael Lysons · @mlysons
13 followers · 27 posts · Server iosdev.space

I’m a data person, not a UI person.

I’m simplifying here, but…

I love and do not love .
I do not love and do love .

I think it’s because SwiftUI enables me to do stuff I am bobbins at, whereas SwiftData makes me cry because it’s not just raw SQL.

Again, simplifying. An observation (I flippin’ love the new Observable stuff!) is all.

#swiftui #UIKit #swiftdata #grdb

Last updated 1 year ago

Manish Vij · @vij
144 followers · 10537 posts · Server sfba.social

now autosaves constantly in background after switching to . Win-win-win:

• No data loss if beta crashes
• Less work, no explicit save
• No save button, simpler UI
• Background thread doesn’t make typing lag

#goodbatch #swiftdata

Last updated 1 year ago

Gwendal Roué · @groue
381 followers · 353 posts · Server hachyderm.io

@helge Thanks for the heads up! I follow your adventures with great interest, even though I'm still not playing with it at all. Currently too busy trying to figure out a good Swift version of the SQLite JSON functions in in github.com/groue/GRDB.swift/pu (surprisingly less easy that one could expect, due to sensitive SQLite subtleties 🤯)

#swiftdata #grdb

Last updated 1 year ago

Gavin Jones · @gavtron
13 followers · 45 posts · Server mstdn.social

I did have to add a wrapper to my swiftUI previews so that they played nice with the models though!

#swiftdata

Last updated 1 year ago

Joseph Quigley · @quigs
0 followers · 6 posts · Server iosdev.space

I know writing a custom NSMergePolicy is rarely needed, but if you do find you need to write one, Apple’s lack of documentation makes it nearly impossible to diagnose if you do it wrong. I wrote the missing documentation so you don’t have to flounder around like I did.

TLDR: Be sure to call super, or else it all falls apart. Not intuitive, but the base merge policy respects your changes.

quigs.blog/how-to-write-a-cust

#coredata #swiftdata #iOS #apple #developer #iosdev #documentation #blog #howto

Last updated 1 year ago

Axel Le Pennec · @alpennec
240 followers · 552 posts · Server iosdev.space

Is this documentation new?

It seems we finally have some guidance on how to use the same View to create & edit an object with the option to discard: by using state variables for each editable value & not by binding directly to a model object.

developer.apple.com/documentat

#swiftdata

Last updated 1 year ago

Craig Clayton · @thedevme
574 followers · 243 posts · Server mastodon.cloud

🚀 Big News! My course "Design to Presents... Building an Apple Watch Store App in iOS 17" launches Sept 18! 🗓️ Be among the first to master & iOS 17 features. 📱 Pre-order NOW 4 a reduced rate! 🎉 Don't miss this deal!

youtu.be/_xPgWVReOzE

#swiftui #swiftdata #iosdevelopment

Last updated 1 year ago

SENTINELITE · @SENTINELITE
57 followers · 749 posts · Server moth.social

I'm wanting to keep track of the user's most recent navigation status.

Currently I have that tracked in an @Observable class, but feel like it would make sense to move this to my store, for persistence?

BUT, I want the user to have saved state per device, ie it should be a "local" persisted value.

Should I just use @AppStorage? Is there a way to have values tracker per device (like .unique/.transient, etc.)?

Should it just be a secondary store?

#swiftdata

Last updated 1 year ago

tundsdev 💫 · @tundsdev
868 followers · 420 posts · Server iosdev.space

If you've ever wondered, how to prefill SwiftData with items that have a relationship, then this is the video for you 🤝

We'll cover:

💕 Preloading items with relationships
🏞️ Preloading images
👀 Using Codable with SwiftData

📹 linktw.in/umUHJ3

#swiftdata #swiftui

Last updated 1 year ago

Steven Lipton · @MakeAppPie
56 followers · 1209 posts · Server techhub.social

@thillsman @joshdholtz yes, but in my case the last one was such an unmitigated disaster I'm starting from scratch. Someday there will be real docs. Or everyone will watch this course I'm writing.

#swiftdata

Last updated 1 year ago

Cihat Gündüz · @Jeehut
234 followers · 318 posts · Server iosdev.space

The UI of my app to stay connected with people long-term is complete, including ! 💪

Last 2 steps before kicking off the :
– Persistence with
– Server & API with

Let’s see how nice SwiftData really is!

#contacts #search #beta #swiftdata #vapor #wip #napdev #swiftui #BuildInPublic

Last updated 1 year ago

Swift Remote Studio · @swiftremotestudio
72 followers · 104 posts · Server iosdev.space

Join us tomorrow for Swift Remote Coffee! ☕

Swift Remote Studio’s weekly virtual coffee meetup for Swift/iOS/Mac developers that takes place on Zoom every Wednesday at 9am PT.

We usually end up chatting about , etc.

1. Sign up at swiftremotestudio.com
2. Join the Slack workspace via the invite email
3. Go to the "coffee" channel in Slack for the Zoom URL

See you there! 😃

#xcode #xcode15 #swiftdata #swiftui #visionos #visionpro #iosdev #worktogetherswiftly #swiftremotestudio

Last updated 1 year ago

Axel Le Pennec · @alpennec
231 followers · 528 posts · Server iosdev.space

So many reasons to target iOS 17+ & drop support for older versions:
- MapKit for (annotations & overlays)
- now supports live updates using Swift concurrency’s async/await capability
- (no, just a joke, I'll stick to my stack for now)

#swiftui #corelocation #swiftdata #coredata

Last updated 1 year ago

Steven Lipton · @MakeAppPie
56 followers · 1172 posts · Server techhub.social

I figured out more about this ‘bug’. It wasn’t what I thought it was. You cannot use the word `description` as a variable in a schema anywhere. it also hepls when debugging to completely reset your device.

#swiftdata

Last updated 1 year ago

Steven Lipton · @MakeAppPie
56 followers · 1172 posts · Server techhub.social

ANNNNNNNDDDD...... :scream: So, I spent a good part of the day fixing one problem, only to find the problem is part of an even bigger problem. Reading from a class or struct that adopts Codable causes a fatal error in . I was loading a JSON file with my menu data, and apparently, 1) Codable does not like the enum dodge I was using above to read JSON data, so I changed it to simple strings so it would read correctly. 2) Then I get this lovely crash
SwiftData/SchemaProperty.swift:369: Fatal error: Unexpected type for CompositeAttribute: MenuItem
I have a way around Codable for this project, though it will take some work, but that is a very bad thing.

#swiftdata

Last updated 1 year ago

Steven Lipton · @MakeAppPie
56 followers · 1170 posts · Server techhub.social

Now I remember why I avoid backend or any Model development and Stick to UI.

#swiftdata

Last updated 1 year ago

olof hennig · @ohennig
7 followers · 89 posts · Server mastodon.nu

TIL: The simulator is not reliable when testing with .

You need at least two physical devices, unless you want to spend hours on trying to figure out why your your data doesn't sync – when it actually is syncing as expected.

#CloudKit #swiftdata

Last updated 1 year ago

SENTINELITE · @SENTINELITE
52 followers · 666 posts · Server moth.social

I’m a tad confused.

• Do we need to explicitly set defaults for *every* variable in our @Models?

I have some structs that I *don’t* want to sync, yet, as some of the stored values don't conform to `Codable`.

•  Am I right in assuming that @Transient will "suppress" those warnings?

Lastly, it appears we *should* be marking things as Optional, but then I have nth code refs to change. Is there a better way to handle these?

#swiftdata #swift

Last updated 1 year ago