
import SwiftUI

struct ContentView: View {
   var body: some View {
      VStack {
         Text("Hello, world!")
            .padding()
         Button("Run Task") {
            Task {
               let imageName = await loadImage(name: "My Image")
               print(imageName)
            }
         }
      }
   }
   func loadImage(name: String) async -> String {
      try? await Task.sleep(for: .seconds(5))
      return "Name: \(name)"
   }
}

#Preview {
    ContentView()
}
