CommonUtils 1.6.2.2

CommonUtils 1.6.2.2

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

BtB MobileKaren Lusinyan 维护。



 
依赖
AFNetworking>= 0
DateTools>= 0
 

CommonUtils 1.6.2.2

  • 作者
  • Karen Lusinyan

CommonUtils

[![CI 状态](http://img.shields.io/travis/Karen Lusinyan/CommonUtils.svg?style=flat)](https://travis-ci.org/Karen Lusinyan/CommonUtils)
Version
License
Platform

用法

要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install

CommonNotification 示例

步骤 1:如何配置

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
}

步骤 2:如何添加通知

    // 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];

步骤 3:如何点击通知时执行操作动作

    [[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