VLCKit: Change the notification name from NSString to NSNotificationName and unify the naming convention
Change the notification name from NSString to NSNotificationName and unify the naming convention.
before
// Obj-C
NSString *name = VLCMediaPlayerTimeChanged;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(method) name: name object: nil];
// Swift
let name: Notification.Name = .init(rawValue: VLCMediaPlayerTimeChanged)
NotificationCenter.default.addObserver(self, selector: #selector(method), name: name, object: nil)
after
// Obj-C
NSNotificationName name = VLCMediaPlayerTimeChangedNotification;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(method) name: name object: nil];
// Swift
let name: NSNotification.Name = VLCMediaPlayer.timeChangedNotification
NotificationCenter.default.addObserver(self, selector: #selector(method), name: name, object: nil)
Referenced implementation of Apple Framework
// Obj-C
NSNotificationName name = UIApplicationDidBecomeActiveNotification;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(method) name: name object: nil];
// Swift
let name: NSNotification.Name = UIApplication.didBecomeActiveNotification
NotificationCenter.default.addObserver(self, selector: #selector(method), name: name, object: nil)
best regards.
Edited by Felix Paul Kühne