JMSystemNotifications 0.0.1

JMSystemNotifications 0.0.1

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年4月

Jérôme Morissard 主维护。



  • 作者:
  • Jérôme Morissard

JMSystemNotifications 是一个 Objective-C 库,可以轻松注册 OS 系统通知。这里列出了系统所有可能发送的通知,共有 114 个 :)。

Image

注册系统通知

- (BOOL)jm_observeNotification:(JMSystemNotification)notification usingBlock:(JMNotificationBlock)block;
- (BOOL)jm_observeNotification:(JMSystemNotification)notification usingBlock:(JMNotificationBlock)block error:(NSError **)error;

有错误处理,因为有些通知与 iOS 版本有关联

BOOL addObserverSucessfully = [self jm_observeNotification:JMUserDefaultsDidChangeNotification usingBlock:^(NSNotification *notif) {
    NSLog(@"JMUserDefaultsDidChangeNotification");
}];

NSError *error;
[self jm_observeNotification:JMUserDefaultsDidChangeNotification usingBlock:^(NSNotification *notif) {
    NSLog(@"JMUserDefaultsDidChangeNotification");
} error:&error];

注销系统通知

- (void)jm_removeObservedNotification:(JMSystemNotification)notification;
- (void)jm_removeObservedNotifications;

待办事项

  • AVFoundation
  • CloudKit
  • ExternalAccessory
  • GameKit
  • GameController
  • HealthKit
  • MediaPlayer
  • NetworkExtension
  • NewsstandKit
  • CoreBluetooth?
  • CoreMedia?
  • CoreFoundation?