Skip to content

Commit 2a2d73e

Browse files
authored
Merge pull request #1172 from ianpartridge/nsnotification
2 parents 720139a + 0b59aae commit 2a2d73e

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(*,obsoleted:4.0,renamed:"addObserver(forName:object:queue:using:)")
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)