Instance Property

name

The name of the notification.

Declaration

var name: NSNotification.Name { get }

Discussion

Typically you use this property to find out what kind of notification you are dealing with when you receive a notification.

Special Considerations

Notification names can be any string. To avoid name collisions, you might want to use a prefix that’s specific to your application.

See Also

Getting Notification Information

var object: Any?

The object associated with the notification.

var userInfo: [AnyHashable : Any]?

The user information dictionary associated with the notification.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software