Chapter 4 Warning: Reference to captured var 'countdown' in concurrently-executing code; this is an error in Swift 6

Swift 6 will not allow referencing or mutating the ‘countdown’ variable inside the scheduleTimer block.
What would be a Swift 6-compatible solution?

Swift 6 isn’t released yet, I can’t speculate how the code would look like when released.

2 Likes