A container for information broadcast through a notification center to all registered observers.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
Framework
- Foundation
Declaration
struct Notification
A container for information broadcast through a notification center to all registered observers.
SDKs
Framework
struct Notification
init(name: Notification .Name, object: Any?, user Info: [Any Hashable : Any]?)
Initializes a new notification.
typealias Notification .Name
An alias for a type used to represent the name of a notification.
struct NSNotification .Name
The type used for the name of a notification.
var name: Notification .Name
A tag identifying the notification.
var object: Any?
An object that the poster wishes to send to observers.
var user Info: [Any Hashable : Any]?
Storage for values or objects related to this notification.
static func != (Notification, Notification) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func == (Notification, Notification) -> Bool
Compares two notifications for equality.
var description: String
A textual description of the notification.
var debug Description: String
A textual description of the notification suitable for debugging.
var custom Mirror: Mirror
A mirror that reflects the notification.
var hash Value: Int
The computed hash value for the notification.
class NSNotification
An object containing information broadcast to registered observers that bridges to Notification
; use NSNotification
when you need reference semantics or other Foundation-specific behavior.
typealias Notification .Reference Type
An alias for this value type's equivalent reference type.
class Notification Center
A notification dispatch mechanism that enables the broadcast of information to registered observers.
class Notification Queue
A notification center buffer.