0

This code loads the image:

AsyncImage(url: URL(string: "https://ychef.files.bbci.co.uk/976x549/p01j3jyb.jpg")) { phase in
    switch phase {
    case .success(let image):
        image
            .resizable()
            .frame(width: 140, height: 140)
    default:
        Text("empty")
    }
}

This code does not:

AsyncImage(url: URL(string: "https://ychef.files.bbci.co.uk/976x549/p01j3jyb.jpg")) { phase in
    switch phase {
    case .success(let image):
        image
            .resizable()
            .frame(width: 140, height: 140)
    default:
        EmptyView()
    }
}

Why? The only difference is the default case.

Xcode 13.3.1

Marty
  • 5,926
  • 9
  • 53
  • 91

0 Answers0