I want to create an additional NotificationCenter
instance to separate my internal notifications from system notifications. However, when I looked at the class implementation, I did not understand what I was looking at.
open class NotificationCenter : NSObject {
open class var default: NotificationCenter { get }
}
Where is the getter? What does default
exactly get? This is what I was expecting to see:
extension NotificationCenter {
static let default = NotificationCenter()
}
Is the default
property a static
singleton that we just don't see and the getter is just returning it?
And to implement my own custom center, could I just declare it the following way?
extension NotificationCenter {
static let custom = NotificationCenter()
}