UIUserNotificationSettings-Extension 0.1.2

UIUserNotificationSettings-Extension 0.1.2

测试测试过的
Lang语言 Obj-CObjective C
许可证 MIT
发布最近发布2015年8月

alexruperez维护。




Dependency Status Analytics

概述

UIUserNotificationSettings-Extension提供了帮助方法,使你处理交互式通知变得更容易。

UIUserNotificationSettings-Extension Screenshot 1 UIUserNotificationSettings-Extension Screenshot 2 UIUserNotificationSettings-Extension Screenshot 3

使用方式

安装

或者你可以将以下文件添加到你的项目中

  • UIUserNotificationSettings+Extension.m
  • UIUserNotificationSettings+Extension.h

要运行示例项目,克隆仓库,然后从示例目录首先运行pod install

示例

UIUserNotificationAction *openAction = [UIUserNotificationAction foregroundActionWithIdentifier:@"open_action" title:@"Open with alert 😉"];
UIUserNotificationAction *deleteAction = [UIUserNotificationAction backgroundDestructiveActionWithIdentifier:@"delete_action" title:@"Delete 😱" authenticationRequired:YES];
UIUserNotificationAction *okAction = [UIUserNotificationAction backgroundActionWithIdentifier:@"ok_action" title:@"Ok 👍" authenticationRequired:NO textInput:YES];

UIUserNotificationCategory *userNotificationCategory = [UIUserNotificationCategory categoryWithIdentifier:@"default_category" defaultActions:@[openAction, deleteAction, okAction] minimalActions:@[okAction, deleteAction]];

UIUserNotificationSettings *userNotificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAll categoriesArray:@[userNotificationCategory]];

[[UIApplication sharedApplication] registerUserNotificationSettings:userNotificationSettings];

等等。

  • 欢迎贡献。
  • 我们会感谢(让我们传播出去!),但不是强制的。

使用过吗?喜欢/讨厌它?

通过@alexruperez推文给作者,并查看alexruperez的博客:http://alexruperez.com

许可证

UIUserNotificationSettings-Extension在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。