Skip to content

Latest commit

 

History

History

App6

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

SwiftUI asynchronous operation example

About

This SwiftUI application demonstrates how to schedule synchronous and asynchronous work when a Button is tapped.

Refer to the four Buttons in the ContentView struct. Each Button calls into a function of a MainActor view model either directly or via a Task. Each of the functions in the view model is declared as nonisolated or async or neither or both.

Further reading

  1. Should I declare a 'nonisolated' or 'async' function in my 'MainActor' view model for work that will run inside and outside of the MainActor context?