Questions tagged [swiftui-asyncimage]
28 questions
9
votes
2 answers
SwiftUI AsyncImage animation misbehavior
While testing out SwiftUI, I've found that AsyncImage does not work well while animating a transition. It seems to settle on its final position of the transition before the rest of the UI has moved there, making the animation seem weird or off.
My…

Rafael Costa
- 139
- 6
8
votes
1 answer
AsyncImage not rendering all images in a List and producing error Code =-999 "cancelled"
I'm having trouble getting all images to show in a List using AsyncImage. When you first run the app, it seems fine but if you start scrolling, some Images aren't shown. Either the ProgressView doesn't update until the row is scrolled outside of the…

Tony
- 91
- 4
4
votes
3 answers
Image doesn't appear with AsyncImage in Swiftui
I have AsyncImage inside a TabView. When I do this the image never appears. I just see the progress bar.
@available(iOS 15.0, *)
struct TEST: View {
var body: some View {
VStack {
TabView {
…

Rene Robles
- 83
- 1
- 6
2
votes
0 answers
Asyncimage not loading image preview on swift playgrounds 4.1 [mac] app
The URL posted above shows an example of the problem i can't seem to solve so far. On the ipad version of swift playgrounds the use of Asyncimage works, however when i load the same code on the mac verison of swift playgrounds, the image preview…

Liam Rogers
- 21
- 3
2
votes
1 answer
AsyncImage not loading inside VStack
When using an AsyncImage inside a VStack, the image never loads. The handler is called once, and the AsyncImagePhase is .empty. Sample code:
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
…

Marty
- 5,926
- 9
- 53
- 91
2
votes
1 answer
Matched Geometry Effect with AsyncImage iOS 15
Consider the following example:
struct ContentView: View {
@State var showSplash: Bool = true
@Namespace var animationNamespace
var body: some View {
ZStack {
if showSplash {
GeometryReader {…

Antonio Chan
- 160
- 2
- 10
1
vote
2 answers
How do I prevent an image from being squashed in a LazyVGrid cell?
I have a simple grid view where I have cells that show a square image with a couple of lines of text below it.
I'm trying to get the image to fill the square, clipped and not squashed in any way. I have got close, but the image seems to be…

Halpo
- 2,982
- 3
- 25
- 54
1
vote
0 answers
AsyncImage doesn't work in images loaded for iOS widgets using SwiftUI
This is my simple class file:
import SwiftUI
struct NetworkImage: View {
let url: URL?
var body: some View {
//1st part
if let url = URL(string: "https://thumbs.dreamstime.com/b/tiger-portrait-horizontal-11392212.jpg"),
…

Bartłomiej Semańczyk
- 59,234
- 49
- 233
- 358
1
vote
1 answer
async image in SwiftUI
I am working on an api, in which i retrieve the texts but the image from the api is not showing inside the view. I have given it an async image. The async image shows as a grey part in the view. Please let me know what is missing here. It would be…
user19179931
1
vote
1 answer
Adding a placeholder to AsyncImage and showing a different image if AsyncImage fails to get the image
I'm trying to use an AsyncImage to show a ProgressView while it gets an image from a URL, but if it fails to get the image then a different image should be displayed. My code is working in the sense that it will show the different image if the…

jbeu425
- 115
- 7
1
vote
1 answer
SwiftUI List containing AsyncImages only updates when scrolled out of view
I have a List of Pokemon objects, displayed in PokemonCells. When these PokemonCells are created, it checks if it has a PokemonDetail object. The PokemonDetail is an @State var. If it's nil, it triggers a ProgressView and a call to fetch the…

mark_eerstift
- 11
- 2
1
vote
0 answers
SwiftUI AsyncImage orientation
I am using AsyncImage to download a jpg from my Parse Server. If I download the file manually it has an orientation of 6 (90 Degree counterclockwise), but when the file is returned by AsyncImage, it is missing this orientation and appears…

David
- 305
- 2
- 10
1
vote
0 answers
Turn AsyncImage to UIImage
I got an AsyncImage and want to use UIImageWriteToSavedPhotosAlbum for save my AsyncImage to user library.
I used Paul Hudson course for find what to do but it downloads an empty white picture on library on my iPhone and on simulator.
Here's the…

Knight E
- 11
- 3
1
vote
0 answers
AsyncImage is Rotating Portrait Images
I am downloading a JPG image from a remote server. If I use AsyncImage, portrait images taken from the phone's library are rotated 90 degrees. Landscape images taken from the phone's photo library are fine. Also, portrait and landscape photos taken…

C6Silver
- 3,127
- 2
- 21
- 49
0
votes
1 answer
AsyncImage inside list is consuming a lot of memory when scrolling and eventually crash in SwiftUI
Here is what I have done: the app crashes when the memory goes over 1 GB or more. I tried commenting asyncImage, and it took only 25–30 MB of memory and didn't crash.
List {
ForEach(0..<(self.imageURLArray.count), id: \.self) { i in
…

Fahim Rahman
- 247
- 3
- 13