[SwiftUI] AsyncImage that can perform downsampling

Prologue This article is originated from AsyncImage that can perform downsampling. AsyncImage is a SwiftUI component to show Image fetched from internet resource. It is available since iOS15 like the following. AsyncImage(url: url) { phase in switch phase { case .empty: ProgressView().progressViewStyle(.circular) case .failure: Text("Error") case .success(let image): image .resizable() .frame(width: 56, height: 56) @unknown default: fatalError() } } Such a simple way is beneficial to build a UI layout with ease....

February 3, 2023 · 4 min · Fumiya Tanaka