When migrating legacy Swift code from completion handlers to async/await using withCheckedContinuation, a critical pitfall is allowing the continuation to be resumed more than once. In one production case, a completion handler fired twice, causing the async continuation to resume twice and crash randomly. The fix involves enforcing a single resume path and guarding state carefully — continuations must be treated as a one-shot mechanism.
•1m watch time
Sort: