Choosing Swift Actors Over DispatchQueue for Thread-Safe State
Use Swift actors for mutable shared state in new code targeting iOS 15+/macOS 12+. Actors provide compile-time data-race isolation; DispatchQueue only serializes at runtime and deadlocks easily. Includes decision criteria, comparison table, trade-offs, and a verified Counter actor implementation.