Caching with SwiftUI Task Modifier | REST API Data | In Memory & Disk | Expiration Timestamp
We are going to learn on how to implement Caching Layer to a News App that currently using iOS 15 SwiftUI Task Modifier to trigger data fetching. At the end of this video, we should be able implement the Cache with these requirements below to improve the efficiency of our app: - In-memory based Cache. - Disk based Cache that survives app restart. Display cache data when the user is offline. - Thread safe data access with Actor type. - Expiration timestamp cache invalidation - Manual cache invalidation. - Automatic cache eviction when system resource are low. #swiftui #iosdev #caching This tutorial is made using the following: - Xcode 13 Beta 5 - iOS 15 Developer Beta 7 Timeline: 00:00 Introduction, Demo, and Getting Started 06:39 Building In Memory Cache Actor 17:49 Integrating Cache to Observable Object/ViewModel 23:20 Testing and Handling Manual Cache Invalidation 29:30 Create Cache Protocol and Shared Extension 36:32 Tracking Keys of Cache Entry 41:32 Building Disk Cache Actor with Codable Support 48:47 Integrating Disk Cache to Observable Object and Testing 53:01 Challenge and Conclusion GitHub Repository Link: https://github.com/alfianlosari/NewsAppSwiftUI Part 1 - Build an iOS News App with SwiftUI 3 & NewsAPI | Full Course: https://youtu.be/LRnbFjq0bTM Part 2 - Add iPadOS UX Adaptivity to an iOS News App with SwiftUI 3 | Full Course: https://youtu.be/AcV440Pv9a4 Part 3 - Building macOS News App with SwiftUI 3 & NewsAPI | Full Course: https://youtu.be/YSR_Hk-ivrA Part 4 - Building watchOS News App with SwiftUI 3 & NewsAPI | Full Course: https://youtu.be/2qA-gDWbOTU Part 5 - Building tvOS News App with SwiftUI 3 and NewsAPI: https://youtu.be/TQG79xncC74 NewsAPI Website: https://newsapi.org Caching in Swift | Swift by Sundell: https://www.swiftbysundell.com/articles/caching-in-swift/
Download
0 formatsNo download links available.