extension NotificationCenter {
func addObserverOnce(forName name: NSNotification.Name?, object obj: Any?, queue: OperationQueue?, using block: @escaping (Notification) -> Void) {
weak var token: NSObjectProtocol?
token = addObserver(forName: name, object: obj, queue: queue) {notification in
token.map(self.removeObserver)
block(notification)
}
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)