Skip to content

Commit 0df8945

Browse files
glennaianpartridge
authored andcommitted
NotificationCenter should use NSNotification.Name per docs (swiftlang#1208)
NotificationCenter should use NSNotification.Name per docs
1 parent 287ecb7 commit 0df8945

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Foundation/NSNotification.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ open class NotificationCenter: NSObject {
169169
}
170170
}
171171

172-
open func post(name aName: Notification.Name, object anObject: Any?, userInfo aUserInfo: [AnyHashable : Any]? = nil) {
172+
open func post(name aName: NSNotification.Name, object anObject: Any?, userInfo aUserInfo: [AnyHashable : Any]? = nil) {
173173
let notification = Notification(name: aName, object: anObject, userInfo: aUserInfo)
174174
post(notification)
175175
}
@@ -189,11 +189,11 @@ open class NotificationCenter: NSObject {
189189
}
190190

191191
@available(*,obsoleted:4.0,renamed:"addObserver(forName:object:queue:using:)")
192-
open func addObserver(forName name: Notification.Name?, object obj: Any?, queue: OperationQueue?, usingBlock block: @escaping (Notification) -> Void) -> NSObjectProtocol {
192+
open func addObserver(forName name: NSNotification.Name?, object obj: Any?, queue: OperationQueue?, usingBlock block: @escaping (Notification) -> Void) -> NSObjectProtocol {
193193
return addObserver(forName: name, object: obj, queue: queue, using: block)
194194
}
195195

196-
open func addObserver(forName name: Notification.Name?, object obj: Any?, queue: OperationQueue?, using block: @escaping (Notification) -> Void) -> NSObjectProtocol {
196+
open func addObserver(forName name: NSNotification.Name?, object obj: Any?, queue: OperationQueue?, using block: @escaping (Notification) -> Void) -> NSObjectProtocol {
197197
let object = NSObject()
198198

199199
let newObserver = NSNotificationReceiver()

0 commit comments

Comments
 (0)