Proyectos
Ver en GitHub
V8tr/AsyncImage
Acerca de
Asynchronous Image Loading from URL in SwiftUI
Diseño y multimediaCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalArticle related to this project
AsyncImage
The project demonstrates how to load images asynchronously in SwiftUI.
Usage:
// Image URLs to load
let posters = [
"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)! }
struct ContentView: View {
var body: some View {
List(posters, id: \.self) { url in
AsyncImage(
url: url,
placeholder: { Text("Loading ...") },
image: { Image(uiImage: $0).resizable() }
)
.frame(idealHeight: UIScreen.main.bounds.width / 2 * 3) // 2:3 aspect ratio
}
}
}
Result:
Explorar proyectos relacionados
Cargando…