Class
NotificationCenter
class NotificationCenter
Topics
Protocols
protocol AsyncMessageA protocol for creating types that you can post to a notification center, which posts them to an arbitrary isolation.protocol MainActorMessageA protocol for creating types that you can post to a notification center and bind to the main actor.protocol MessageIdentifierAn optional identifier to associate a given message with a given type.
Structures
struct BaseMessageIdentifierA type for use when defining optional Message identifiers.struct ObservationTokenA unique token representing a single observer registration in a notification center.
Initializers
Instance Methods
func addObserver(of:for:using:)Adds an observer to a center for messages delivered on the main actor with a given subject and identifier.func messages(of:for:bufferSize:)Returns an asynchronous sequence of messages produced by this center for a given subject and identifier.func post(_:)Posts a given main actor message to the notification center.func post(_:subject:)Posts a given main actor message to the notification center.func removeObserver(NotificationCenter.ObservationToken)Stops the observation represented by the given observation token.
Type Properties
Default Implementations
Relationships
Conforms To
Swift.CopyableSwift.CustomStringConvertibleSwift.EquatableSwift.EscapableSwift.SendableSwift.SendableMetatype