Instance MethodFoundationEssentials
post(_:subject:)
iOS 26.0+
iPadOS 26.0+
Mac Catalyst 26.0+
macOS 26.0+
tvOS 26.0+
visionOS 26.0+
watchOS 26.0+
Posts a given main actor message to the notification center.
@MainActor func post<Message>(_ message: Message, subject: Message.Subject) where Message : NotificationCenter.MainActorMessage, Message.Subject : AnyObject
Parameters
messageThe message to post.
subjectThe subject instance that corresponds to the message.