Skip to content

Instantly share code, notes, and snippets.

View rickclephas's full-sized avatar

Rick Clephas rickclephas

View GitHub Profile
@rickclephas
rickclephas / nested-swift-async-await.swift
Last active April 29, 2022 13:12 — forked from christianselig/nested-swift-async-await.swift
Using Swift concurrency async await within a checked continuation
func doACoolAsyncThing() async -> Bool {
let result = await withCheckedContinuation { continuation in
SomeAPI.oldSchoolContinuationHandler { result in
continuation.returning(result)
}
}
guard result else { return false }
return await isThe50000thDigitOfPi9()
}