beeminder / BeeSwift

Official Beeminder for iOS app
Other
29 stars 5 forks source link

Run most tasks in the MainActor #347

Closed theospears closed 1 year ago

theospears commented 1 year ago

We use Task to run async code from a sync context. By default this runs on a background thread, but we usually instead want to run in a UI thread. Previously we were dispatching back to the UI thread to do this. Here instead we mark most tasks as needing to run in the UI thread, removing the need for this.

Test Plan: Ran on device, exercising a few code paths.