From the documentation , my focus:
You can subclass NSNotification contain information in addition to the name, object, and notification dictionary. These additional data must be agreed between observers and observers.
NSNotification - a cluster of classes without instance variables. Therefore, you must subclass NSNotification and override the primitive methods name , object and userInfo . You can select any initializer assigned to you, but make sure that your initializer does not call [super init] . NSNotification not intended to be created directly, and the init method throws an exception.
Swift does not currently have an NSNotification subclass, since Swift does not have the concept of "uninitializable classes" and requires all subclasses to call their superclass init (which is incorrect in this case).
You will need to write a subclass in Objective-C and move it to your Swift code.
Unfortunately, even though you can declare your Objective-C class public, this information is lost in the bridge process. From the docs :
In addition to these Foundation collection classes, Objective-C light generics are ignored by Swift. Any other types that use lightweight generics are imported into Swift, as if they were not parameterized.
: (
source share