Skip to content

Commit cfe12da

Browse files
committed
Notification: fix addObserver(forName:object:queue:using:) signature
1 parent 720139a commit cfe12da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Foundation/NSNotification.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,13 @@ open class NotificationCenter: NSObject {
187187
self._observers = _observers.filterOutObserver(observer, name: aName, object: object)
188188
})
189189
}
190-
190+
191+
@available(swift, obsoleted: 4.0)
191192
open func addObserver(forName name: Notification.Name?, object obj: Any?, queue: OperationQueue?, usingBlock block: @escaping (Notification) -> Void) -> NSObjectProtocol {
193+
return addObserver(forName: name, object: obj, queue: queue, using: block)
194+
}
195+
196+
open func addObserver(forName name: Notification.Name?, object obj: Any?, queue: OperationQueue?, using block: @escaping (Notification) -> Void) -> NSObjectProtocol {
192197
let object = NSObject()
193198

194199
let newObserver = NSNotificationReceiver()

0 commit comments

Comments
 (0)