Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Asynchronous Image Loading from URL in SwiftUI

License

NotificationsYou must be signed in to change notification settings

V8tr/AsyncImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


AsyncImage

The project demonstrates how to load images asynchronously in SwiftUI.

Usage:

// Image URLs to loadletposters=["https://image.tmdb.org/t/p/original/pThyQovXQrw2m0s9x82twj48Jq4.jpg","https://image.tmdb.org/t/p/original/vqzNJRH4YyquRiWxCCOH0aXggHI.jpg","https://image.tmdb.org/t/p/original/6ApDtO7xaWAfPqfi2IARXIzj8QS.jpg","https://image.tmdb.org/t/p/original/7GsM4mtM0worCtIVeiQt28HieeN.jpg"].map{URL(string: $0)!}structContentView:View{varbody:someView{List(posters, id: \.self){ urlinAsyncImage(                url: url,                placeholder:{Text("Loading ...")},                image:{Image(uiImage: $0).resizable()}).frame(idealHeight:UIScreen.main.bounds.width/2*3) // 2:3 aspect ratio}}}

Result:

How to load image from URL asynchronously in SwiftUI

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2026 Movatter.jp