Slide 20
Slide 20 text
actors
• TableActor’s data: reference to mainActor, and theList
• actor can send messages to any other actor
• actor methods are the messages that actors accept
• actor methods are implicitly async, so they can freely call async methods
and await their results
• An actor method cannot return a value, throw an error, or have an inout
parameter.
• Actor method parameters must produce independent values when copied
• Local state and non-actor methods may only be accessed by methods
defined lexically on the actor or in an extension to it (whether they are
marked actor or otherwise)
actor func add(entry: String)
mainActor.updateTableView(theList)