Network Manager Part 3 - ViewModel and Loading State
In the first two videos of this series, we built a solid Network Manager for fetching and decoding JSON while handling errors cleanly in SwiftUI. In this third part, we focus on improving our views by introducing a reusable, generic data view model that works across multiple screens. You will learn how to move networking logic out of SwiftUI views, manage loading state with progress indicators, and create a reusable loader view modifier. We also cover pull to refresh, task cancellation issues with refreshable, and how to avoid them safely. Finally, we generalize the view model so it can handle arrays, single objects, and custom JSONDecoder configuration such as ISO 8601 date decoding. If you want to support my work, you can buy me a coffee :) https://ko-fi.com/stewartlynch/ My Newsletter https://stewartlynch.kit.com Channel Listing Mac App (Free) https://stewartlynch.gumroad.com/l/obsjz Channel Listing Web App https://stewartlynch.github.io/YouTube/ Table of Contents: 0:00 Introduction 1:20 Building a Quotes DataViewModel 4:43 Adding a Loading State ViewModifier 9:38 Adding Refreshable 12:25 A Generic DataViewModel 17:06 Adding compatibility for single objects 20:21 Adding a decoding Strategy closure Starter Project Files: https://github.com/StewartLynch/NetworkManagerDemo/tree/Part2Completed Completed Project: https://github.com/StewartLynch/NetworkManagerDemo/tree/Part3Completed Full Playlist: https://www.youtube.com/playlist?list=PLBn01m5Vbs4CEzNr3k3KnzCoZFyP6go0N References mentioned in video: Crafting Effective SwiftUI ViewModifiers https://youtu.be/XU7wdjPCXLw Recommended Resources: Big Mountain Studio Books AI Mastery in SwiftUI https://www.bigmountainstudio.com/ai-mastery/77jt8 SwiftUI Views Mastery https://www.bigmountainstudio.com/advanced-views/77jt8 Advanced SwiftUI Views Mastery https://www.bigmountainstudio.com/advanced-views/77jt8 SwiftUI Animations Mastery https://www.bigmountainstudio.com/animations/77jt8 SwiftData Mastery in SwiftUI https://www.bigmountainstudio.com/swiftdata/77jt8 Combine Mastery in SwiftUI https://www.bigmountainstudio.com/combine/77jt8 SwiftUI 5 Book Bundle https://www.bigmountainstudio.com/book-bundle/77jt8
Download
0 formatsNo download links available.