NSNotificationCenter

suggest change

Introduction

iOS notifications are a simple and powerful way to send data in a loosely coupled way. That is, the sender of a notification doesn’t have to care about who (if anyone) receives the notification, it just posts it out there to the rest of the app and it could be picked up by lots of things or nothing depending on your app’s state.

Source : - HACKING with Swift

Parameters

Parameter | Details | ——— | —–– | name | The name of the notification for which to register the observer; that is, only notifications with this name are used to add the block to the operation queue. If you pass nil, the notification center doesn’t use a notification’s name to decide whether to add the block to the operation queue. | obj | The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. If you pass nil, the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer. | queue | The operation queue to which block should be added. If you pass nil, the block is run synchronously on the posting thread. | block | The block to be executed when the notification is received. The block is copied by the notification center and (the copy) held until the observer registration is removed. |

Remarks

An NSNotificationCenter object (or simply, notification center) provides a mechanism for broadcasting information within a program. An NSNotificationCenter object is essentially a notification dispatch table.

For more info, check out the Apple Documentation here

NSNotification & NSNotificationCenter in Swift

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


NSNotificationCenter:
* NSNotificationCenter

Table Of Contents
12 UIView
15 UIColor
26 UIImage
28 CALayer
30 NSDate
36 NSNotificationCenter
40 iBeacon
49 NSTimer
79 NSURL
87 AWS SDK
96 NSData
101 Segues
104 EventKit
105 NSBundle
106 SiriKit
111 StoreKit
117 3D Touch
119 Keychain
122 Block
141 AirDrop
144 UISlider
145 Carthage
146 HealthKit
151 plist
157 MVVM
164 UIPhoenix
166 Simulator
168 NSArray
169 OpenGL
175 Core Data
179 MyLayout
180 UIFont
189 Security
200 Codable