SwiftUI Data Flow in iOS 17 - Observation & @Observable

preview_player
Показать описание

iOS 17 introduces the new Observation Framework as well as the @Observable macro. This is a new an improved way to update your UI when underlying data of a model object changes and the concept of @StateObject and @ObservedObject no longer apply. This has cleaner syntax and better performance so it is a welcomed update.

This tutorial was created using Xcode 15 beta 2 and iOS 17.

My iOS Dev Courses:

WWDC Session on @Observable:

Twitter:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Paul Hudson's Hacking With Swift:

Donny Wals - Combine:

Mark Moeyken’s SwiftUI Books:

#swift #softwaredeveloper #iosdeveloper
Рекомендации по теме
Комментарии
Автор

This video made me think how far Xcode has come; from the days of coding everything in Objective-C, to the early days of storyboards, Simulator sometimes catching all the issues with an app before actually testing on a physical device. Apple has really hit their stride with Swift and SwiftUI.

WestCoastAce
Автор

While these changes might be a bit confusing for us "veteran developers", I believe this new syntax is much nicer than before.

FloWritesCode
Автор

I hope SwiftUI will become stable in my lifetime

gmikay
Автор

Very good update! Thanks for sharing!

I hope SwiftUI will let us use the .toolbar modifier without needing a NavigationView sometime soon.

ryankanno
Автор

Swift - constant improvements. It's nice to see that the language is evolving and so alive.

chestermang
Автор

OH MY GOD, THANK YOU for this video. I was doing everything BUT importing Observation (is it in the docs or a WWDC video?)

danuff
Автор

Any thoughts on how the new changes with @Observation will affect using ViewModels or reinforce not using ViewModels? I think it will depend, but I think it would be great to see how @Observation would impact one of your more involved MVVM projects.

Also, love your videos, thanks for all the content!

dann_beau
Автор

Wow this just made my life easier as I’m learning SwiftUI and building an app for the first time.

twizzlestix
Автор

Yoooo. This was so confusing when I learned it at first. So nice you can just give a class this property wrapper now! So clean.

AlexanderWebster_
Автор

Thinks for sharing!

Can you help to explain a bit more about adding @State against no wrapper at all when declaring an @Observable class variable in a view?

ThisIsMyUniqueHandle
Автор

Great Video of the new SwiftUI update Sean! Thank you so much. Keep going 🎉 I need such videos because they are short and explain core changes as I'm so busy 😂

donathmm
Автор

when you selected all the @Published text at once how did you do that? what do you have to hold / tap on the keyboard? that's cool

blakesheppard
Автор

These changes and the whole SwiftData overhaul makes me want to wait for all of it to get out of beta.
Thankfully until now it seems that it won’t be forced to macOS Sonoma right? That risk I won’t take for sure short term release.

alejmc
Автор

Looks like this is more for observing an existing object... I would keep the older syntax for clarity... I don't agree it's more readable.... It obfuscates the use of that variable in your swiftUI view.... Forcing you to check through the view as to it's use.. That is to say "Is this observable?"... You clearly know if you have a @stateObject declaration... Very cool that you can see what the macro's are doing.... that's a killer feature. Also if performance is actually improved... That's kind of regrettable having to chose between more verbose syntax and faster execution.

ryshask
Автор

Looks good at first, but how do I react to changes in my business logic? Let’s say the filter changes and I want to run a REST call or execute any other business logic.

lukaszc.
Автор

Your videos are awesome! Can you do a video on SwiftData as well and how it compares to CoreData?

jasmanarora
Автор

I don't see the WWDC link in the description box. How can I get that?

Meekismwisdom
Автор

Thank you for this video Sean! That’s going to help a bunch

vladimystfleur
Автор

3:02 how did he select a box like this? A keyboard shortcut?

FelipeCampelo
Автор

One question: the old way uses combine, so that you can subscribe to the @Published properties even from other classes. But this new observable macro doesn’t seem to have this Combine functionality of publishers and subscribers, but it is crucial in many applications. Does this new observable have some combine support or what? I am confused

AkimboFennec
visit shbcf.ru