ExampleAwaitAsync
class API { ... func fetchServerStatus() async throws -> ServerStatus { let (data, _) = try await URLSession.shared.data( from: URL(string: "http://amazingserver.com/status")! ) return ServerStatus(data: data) } } class ViewController { let api = API() let viewModel = ViewModel() func viewDidAppear() { Task { viewModel.serverStatus = try await api.fetchServerStatus() } } }