Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created August 16, 2025 08:50
Show Gist options
  • Save jacobsapps/da2829fe0ae55c08c142a63a4a4e9438 to your computer and use it in GitHub Desktop.
Save jacobsapps/da2829fe0ae55c08c142a63a4a4e9438 to your computer and use it in GitHub Desktop.
@MainActor
func setupUI() async {
await someAsyncWork()
}
func someAsyncWork() async {
// Add breakpoint to test this at runtime - it's on the main thread!
try? await Task.sleep(for: .milliseconds(100))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment