Posts

Showing posts from May, 2025

AsyncImage - SwiftUI

Image
  AsyncImage is a built-in SwiftUI view introduced in iOS 15+ to asynchronously load and display images from a  URL .  It provides a simple way to load images without writing URLSession code to download data in background and set it to ImageView on Main thread . import SwiftUI struct AsyncImageView : View {     var images : [ URL ] = [         URL ( string : "https://picsum.photos/id/1000/400/400" )!,         URL ( string : "https://picsum.photos/id/1001/400/400" )!,         URL ( string : "https://picsum.photos/id/1002/400/400" )!,         URL ( string : "https://picsum.photos/id/1003/400/400" )!,         URL ( string : "https://picsum.photos/id/1004/400/400" )!,         URL ( string : "https://picsum.photos/id/1005/400/400" )!,         URL ( string : "https://picsum.photos/id/1006/400/400" )!,       ...