load

()

async

try

await

Task

sleep

nanoseconds

oneSecond

self

result

sunny

Next, define the view model as a state object using @StateObject, 
with a load() function that can be called by the view model:

struct

ContentView

View

@StateObject

var

viewModel

ContentViewModel

()

var

body

some

View

Text

viewModel

result

rawValue

??

"Loading..."

task

await

viewModel