CNUserNotificationCenter Class Reference
Inherits from | NSObject |
Declared in | CNUserNotificationCenter.h |
Tasks
Creating a User Notification Center
-
+ defaultUserNotificationCenter
Returns the default user notification center.
-
+ customUserNotificationCenter
Allways returns the custom user notification center.
Managing the Delivered Notifications
-
– deliverNotification:
Deliver the specified user notification.
Getting and Setting the Delegate
-
delegate
Specifies the notification center delegate.
property
Properties
delegate
Specifies the notification center delegate.
@property (strong) id<CNUserNotificationCenterDelegate> delegate
Discussion
The delegate must conform to the CNUserNotificationCenterDelegate
protocol.
Declared In
CNUserNotificationCenter.h
Class Methods
customUserNotificationCenter
Allways returns the custom user notification center.
+ (instancetype)customUserNotificationCenter
Discussion
Creating an instance this way the custom implementation of CNUserNotificationCenter
will be used. NSUserNotificationCenter
will be ignored.
Declared In
CNUserNotificationCenter.h
defaultUserNotificationCenter
Returns the default user notification center.
+ (instancetype)defaultUserNotificationCenter
Discussion
Creating an instance this way let the CNUserNotificationCenter
class decide which implementation of notification center will be used regarding the environmental OS X version.
Note:
OS X 10.7 – will return a CNUserNotificationCenter
object
OS X 10.8+ – will return a NSUserNotificationCenter
object
Declared In
CNUserNotificationCenter.h
Instance Methods
deliverNotification:
Deliver the specified user notification.
- (void)deliverNotification:(CNUserNotification *)notification
Parameters
- notification
The user notification.
Discussion
The notification will be presented to the user. The presented property of the NSUserNotification
object will always be set to YES
if a notification is delivered using this method.
Declared In
CNUserNotificationCenter.h