Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created August 16, 2025 08:52
Show Gist options
  • Save jacobsapps/3bb50877eb2337eb10cb7be709e3ee7e to your computer and use it in GitHub Desktop.
Save jacobsapps/3bb50877eb2337eb10cb7be709e3ee7e to your computer and use it in GitHub Desktop.
@MainActor
func setupUI() async {
await someAsyncWork()
}
@concurrent
func someAsyncWork() async {
// with @concurrent attribute, this runs on the background 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