NotificationCenter

class NotificationCenter : NSObject
  • Registers a block to be executed when a matching un-typed notification is posted.

    This method is identical to the Foundation addObserver(forName:object:queue:using:) method but returns a NotificationObservation instance instead.

    Seealso

    addObserver(forName:object:queue:using:)

    Declaration

    Swift

    public func addObserver(forNotificationNamed name: NSNotification.Name?, object obj: Any?, queue: OperationQueue?,
                            using block: @escaping (Notification) -> Void) -> NotificationObservation