Instance Method

publisher(for:object:)

Returns a publisher that emits events when broadcasting notifications.

Declaration

func publisher(for name: Notification.Name, object: AnyObject? = nil) -> NotificationCenter.Publisher

Parameters

name

The name of the notification to publish.

object

The object posting the named notification. If nil, the publisher emits elements for any object producing a notification with the given name.

Return Value

A Publisher that emits events when broadcasting notifications.

See Also

Publishing Notifications to Combine

struct NotificationCenter.Publisher

A publisher that emits elements when broadcasting notifications.