func addObserver()

in Sources/TwitterTextEditor/NotificationCenter.swift [34:43]


    func addObserver(forName name: NSNotification.Name?,
                     object: Any?,
                     queue: OperationQueue?,
                     using block: @escaping (Notification) -> Void) -> NotificationObserverToken
    {
        // Notification center strongly holds this return value until you remove the observer registration.
        let token: NSObjectProtocol = addObserver(forName: name, object: object, queue: queue, using: block)

        return NotificationObserverToken(notificationCenter: self, token: token)
    }