MainActor

    A singleton actor whose executor is equivalent to the main dispatch queue.

    iOS
    13.0+
    macOS
    10.15+
    tvOS
    13.0+
    watchOS
    6.0+
    @globalActor final actor MainActor

    Citizens in _Concurrency

    Conformances

    • protocol Actor

      Common protocol to which all actors conform.

    • protocol AnyActor

      Common marker protocol providing a shared “base” for both (local) Actor and (potentially remote) DistributedActor types.

    • protocol GlobalActor

      A type that represents a globally-unique actor that can be used to isolate various declarations anywhere in the program.

    • protocol Sendable

      A type whose values can safely be passed across concurrency domains by copying.

    Members

    Features