SwiftyPlace Blog
Debugging Swift Concurrency: “Am I on the Main Actor?” (Not the Main Thread)
When working with async Swift code in Swift 6, you’ll eventually hit this classic question: “Is this code running on the main thread?” You might try the old line: …and get hit with this Swift 6 compiler error: ‘Thread.isMainThread’ is unavailable from asynchronous contexts“Work intended for the main actor should be … Read more