@@ -23,7 +23,7 @@ open class NSNotification: NSObject, NSCopying, NSCoding {
23
23
}
24
24
}
25
25
26
- private( set) open var name : NSNotification . Name
26
+ private( set) open var name : Name
27
27
28
28
private( set) open var object : Any ?
29
29
@@ -33,12 +33,8 @@ open class NSNotification: NSObject, NSCopying, NSCoding {
33
33
/* do not invoke; not a valid initializer for this class */
34
34
fatalError ( )
35
35
}
36
-
37
- public convenience init ( name: NSNotification . Name , object: Any ? ) {
38
- self . init ( name: name, object: object, userInfo: nil )
39
- }
40
36
41
- public init ( name: NSNotification . Name , object: Any ? , userInfo: [ AnyHashable : Any ] ? = nil ) {
37
+ public init ( name: Name , object: Any ? , userInfo: [ AnyHashable : Any ] ? = nil ) {
42
38
self . name = name
43
39
self . object = object
44
40
self . userInfo = userInfo
@@ -173,11 +169,7 @@ open class NotificationCenter: NSObject {
173
169
}
174
170
}
175
171
176
- open func post( name aName: NSNotification . Name , object anObject: Any ? ) {
177
- post ( name: aName, object: anObject, userInfo: nil )
178
- }
179
-
180
- open func post( name aName: NSNotification . Name , object anObject: Any ? , userInfo aUserInfo: [ AnyHashable : Any ] ? = nil ) {
172
+ open func post( name aName: Notification . Name , object anObject: Any ? , userInfo aUserInfo: [ AnyHashable : Any ] ? = nil ) {
181
173
let notification = Notification ( name: aName, object: anObject, userInfo: aUserInfo)
182
174
post ( notification)
183
175
}
@@ -196,7 +188,7 @@ open class NotificationCenter: NSObject {
196
188
} )
197
189
}
198
190
199
- open func addObserver( forName name: NSNotification . Name ? , object obj: Any ? , queue: OperationQueue ? , using block: @escaping ( Notification ) -> Void ) -> NSObjectProtocol {
191
+ open func addObserver( forName name: Notification . Name ? , object obj: Any ? , queue: OperationQueue ? , usingBlock block: @escaping ( Notification ) -> Void ) -> NSObjectProtocol {
200
192
let object = NSObject ( )
201
193
202
194
let newObserver = NSNotificationReceiver ( )
0 commit comments