SwiftUI Data Flow with the new Observation - simpler SwiftUI code and improved performance in iOS 17

Опубликовано: 10 Июль 2023
на канале: Karin Prater
15,893
569

In this SwiftUI tutorial, I discuss the new data flow and observation features for iOS 17 and Xcode 15. We explore how these features can simplify your code and improve the performance of your apps. I walk through the process of converting existing code to use the new observation style and highlight potential pitfalls to avoid.
You will learn about the new @Observable macro and the @State and @Bindable property wrappers.
I also demonstrate how to optimize the data flow to only update views when necessary. Overall, the new observation features in Swift UI offer a more streamlined and efficient way to handle data flow in your apps.

I am using Xcode 15 beta 3
⬇️ get the project files at https://github.com/gahntpo/SwiftUIObs...

Overview
00:00 introduction
02:39 demo project and problem with too many view updates
06:41 converting from observableObject to the new Observation
16:55 demo of Observation
21:41 how to write SwiftUI views for better view redraws
31:10 Summary

If you liked what you learned and you want to see more, check out one of my courses!
👨‍💻 my SwiftUI course https://learn.swiftyplace.com/swiftui...
👨‍💻 my Core Data and SwiftUI course https://learn.swiftyplace.com/swiftui...

#SwiftUI #dataflow #observation


Смотрите видео SwiftUI Data Flow with the new Observation - simpler SwiftUI code and improved performance in iOS 17 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Karin Prater 10 Июль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 15,893 раз и оно понравилось 569 людям.