<ul data-eligibleForWebStory="true">Unit testing in iOS can involve tracking state changes using XCTest expectations.Swift Testing introduces the confirmation function for handling async flows, but it can be verbose.An alternative approach involves using actors in Swift for tracking state changes more efficiently.Actors, by default, execute tasks on a shared global concurrency thread pool, making it useful for waiting for state changes.The use of actors simplifies tracking state changes and expectations in code.Example implementation of an actor to track URL changes inside a ViewModel is provided.Actors help in making tests cleaner, easier to read, and align with Swift's modern concurrency model.