Reputation: 33
I have an existing project, in which we have built it using NSNotificationCenter. Now if i want to add rich notification to my app, should all the NSNotification calls be replaced by NSUserNotification?
Without replacing when i tried the notification service extension is never getting called for remote as well as local notification.
Upvotes: 2
Views: 549
Reputation: 26385
They are totally different. NSNotification
s are used as a way to inform objects instances that something has happened in a decoupled way.
This is an implementation of the observer pattern, useful when you need to inform more objects (observers) that an event has happened and they can respond to that event.
NSUserNotification
s are used as a way to inform the user that something as happened and is displayed in the NSUserNotificationCenter
.
Upvotes: 2