测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2019年4月 |
由 BtB Mobile,Karen Lusinyan 维护。
依赖 | |
AFNetworking | >= 0 |
DateTools | >= 0 |
[](https://travis-ci.org/Karen Lusinyan/CommonUtils)
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
AppDelegate.m
#import "CommonNotificationManager.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// in-app notification's basic configuration
[CommonNotificationManager sharedInstance].checkNotificationsTimeInterval = 1.0;
[CommonNotificationManager sharedInstance].imageIcon = [UIImage imageNamed:@"apple"];
[CommonNotificationManager sharedInstance].notificationHeight = 120.0;
... do your other staff
}
// alertBody: notification title
// alertMessage: notification message
// alertAction: noticiation action that will be executed when notificaiton did tap
// fireDate: notification valid date, if [NSDate date] > fireDate the notification will be removed, nil means it will be allive until presented
// priority: if it's High, then the notification will be presented immediately
[[CommonNotificationManager sharedInstance] addNotificationWithAlertBody:@"Message"
alertMessage:@"Lorem ipsum..."
alertAction:@"actionName"
fireDate:nil
priority:CommonNotificationPriorityDefault];
[[NSNotificationCenter defaultCenter] addObserverForName:CommonNotificationDidTap
object:nil
queue:[NSOperationQueue currentQueue]
usingBlock:^(NSNotification * _Nonnull note) {
if ([[note object] isMemberOfClass:[CommonNotification class]]) {
CommonNotification *notification = (CommonNotification *)[note object];
// do something with notification
}
}];
CommonUtils 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile
pod "CommonUtils"
Karen Lusinyan,[email protected]
CommonUtils 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。
RELEASE-INFO:pod trunk push CommonUtils.podspec