Commit a31384b7d46381f8c0dc486295d02593795b514f

Authored by yanglingyu
1 parent 6f9c6634

0.0.5 皮肤换肤逻辑修改

Too many changes to show.

To preserve performance only 15 of 27 files are displayed.

.gitignore 100644 → 100755
1   -# OS X
  1 +*~
2 2 .DS_Store
  3 +*.xcuserstate
  4 +*.xcworkspace
  5 +xcuserdata
  6 +Products/
  7 +*.lock
  8 +Pods
3 9  
4   -# Xcode
5   -build/
6   -Products/
7   -*.pbxuser
8   -!default.pbxuser
9   -*.mode1v3
10   -!default.mode1v3
11   -*.mode2v3
12   -!default.mode2v3
13   -*.perspectivev3
14   -!default.perspectivev3
15   -xcuserdata/
16   -*.xccheckout
17   -profile
18   -*.moved-aside
19   -DerivedData
20   -*.hmap
21   -*.ipa
22   -
23   -# Bundler
24   -.bundle
25   -
26   -# Add this line if you want to avoid checking in source code from Carthage dependencies.
27   -# Carthage/Checkouts
28   -
29   -Carthage/Build
30   -
31   -# We recommend against adding the Pods directory to your .gitignore. However
32   -# you should judge for yourself, the pros and cons are mentioned at:
33   -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
34   -#
35   -# Note: if you ignore the Pods directory, make sure to uncomment
36   -# `pod install` in .travis.yml
37   -#
38   -# Pods/
... ...
CNLiveBaseTools.podspec
1 1  
2 2 Pod::Spec.new do |s|
3 3 s.name = 'CNLiveBaseTools'
4   - s.version = '0.0.4'
  4 + s.version = '0.0.5'
5 5 s.summary = '基础工具库时间声音等工具'
6 6  
7 7 s.description = <<-DESC
... ...
CNLiveBaseTools/Classes/TabBarEditIcon/CNEditAppIconModel.h
... ... @@ -81,6 +81,12 @@ NS_ASSUME_NONNULL_BEGIN
81 81 /*** 安卓(更变颜色,文字更新状态) ***/
82 82 @property (nonatomic, strong) NSString *androidUpdateType;
83 83  
  84 +/// 当前皮肤开始时间
  85 +@property (nonatomic, assign)CGFloat startTime;
  86 +
  87 +/// 当前皮肤结束时间
  88 +@property (nonatomic, assign)CGFloat endTime;
  89 +
84 90  
85 91 @end
86 92  
... ...
CNLiveBaseTools/Classes/TabBarEditIcon/CNLiveEditAppIconManager.h
... ... @@ -51,6 +51,8 @@ NS_ASSUME_NONNULL_BEGIN
51 51  
52 52 /*** 取得旧数据路径图片 ***/
53 53 + (NSString *)getPathWithKey:(NSString *)key;
  54 +/*** 新的取得旧数据路径图片 ***/
  55 ++ (NSString *)getPathWithName:(NSString *)name key:(NSString *)key;
54 56  
55 57 /*** 根据数据更变颜色 ***/
56 58 + (void)editItemTitleColor;
... ...
CNLiveBaseTools/Classes/TabBarEditIcon/CNLiveEditAppIconManager.m
... ... @@ -56,16 +56,55 @@
56 56 /*** ***/
57 57 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
58 58 /*** 取得旧数据,存在存入旧key中,不存在清空旧key ***/
59   - NSDictionary *oldHolidyDic = [userDefaults objectForKey:kHolidayKey_New];
60   - if (oldHolidyDic && oldHolidyDic.count > 0) {
61   - [userDefaults setObject:oldHolidyDic forKey:kHolidayKey];
62   - [[NSUserDefaults standardUserDefaults] synchronize];
  59 + NSDictionary *newHolidyDic = [userDefaults objectForKey:kHolidayKey_New];
  60 + if (newHolidyDic && newHolidyDic.count > 0) {
  61 + NSDictionary *oldHolidayDic = [userDefaults objectForKey:kHolidayKey];
  62 + if (oldHolidayDic && oldHolidayDic.count > 0) {
  63 + CNEditAppIconModel *newIconModel = [CNEditAppIconModel mj_objectWithKeyValues:newHolidyDic];
  64 + CNEditAppIconModel *oldIconModel = [CNEditAppIconModel mj_objectWithKeyValues:oldHolidayDic];//当前时间
  65 + CGFloat currentTime = [CNLiveEditAppIconManager currentTimeStr];
  66 +
  67 + //皮肤开始结束时间相等说明是一套皮肤
  68 + if (newIconModel.holidayTheme.startTime == oldIconModel.holidayTheme.startTime && newIconModel.holidayTheme.endTime == oldIconModel.holidayTheme.endTime) {
  69 + [userDefaults setObject:newHolidyDic forKey:kHolidayKey];
  70 + [[NSUserDefaults standardUserDefaults] synchronize];
  71 +
  72 + }else{
  73 + //不是一套皮肤
  74 + if (currentTime >= newIconModel.holidayTheme.startTime && currentTime <=newIconModel.holidayTheme.endTime){
  75 + if (currentTime >= oldIconModel.holidayTheme.startTime && currentTime <=oldIconModel.holidayTheme.endTime) {
  76 + //两套皮肤都在展示时间内
  77 + if ((oldIconModel.holidayTheme.endTime - oldIconModel.holidayTheme.startTime) > (newIconModel.holidayTheme.endTime - newIconModel .holidayTheme.startTime)) {
  78 + //当前展示皮肤涵盖新的皮肤展示时间则优先展示时间短的皮肤
  79 + [userDefaults setObject:newHolidyDic forKey:kHolidayKey];
  80 + [[NSUserDefaults standardUserDefaults] synchronize];
  81 + }
  82 + }else{
  83 + //当前皮肤超出展示时间则替换
  84 + [userDefaults setObject:newHolidyDic forKey:kHolidayKey];
  85 + [[NSUserDefaults standardUserDefaults] synchronize];
  86 + }
  87 +
  88 + }
  89 + }
  90 + }else{
  91 + //没有旧皮肤直接使用新皮肤
  92 + [userDefaults setObject:newHolidyDic forKey:kHolidayKey];
  93 + [[NSUserDefaults standardUserDefaults] synchronize];
  94 + }
63 95 }else {
64 96 [userDefaults removeObjectForKey:kHolidayKey];
65 97 [[NSUserDefaults standardUserDefaults] synchronize];
66 98 }
67 99  
68 100 }
  101 +//获取当前时间戳
  102 ++ (CGFloat)currentTimeStr{
  103 + NSDate* date = [NSDate dateWithTimeIntervalSinceNow:0];//获取当前时间0秒后的时间
  104 + NSTimeInterval time=[date timeIntervalSince1970]*1000;// *1000 是精确到毫秒,不乘就是精确到秒
  105 + return time;
  106 +}
  107 +
69 108  
70 109  
71 110 /*** 下载zip并解压(只用于新数据) ***/
... ... @@ -179,6 +218,29 @@
179 218 return status;
180 219  
181 220 }
  221 +/*** 新的取得旧数据路径图片 ***/
  222 ++ (NSString *)getPathWithName:(NSString *)name key:(NSString *)key {
  223 +
  224 + if (!key || key.length == 0) {
  225 + return @"";
  226 + }
  227 +
  228 + NSString *imagePath = @"";
  229 +
  230 + NSDictionary *dic = [[NSUserDefaults standardUserDefaults] objectForKey:kHolidayKey];
  231 + if (dic && dic.count > 0) {
  232 + CNEditAppIconModel *iconModel = [CNEditAppIconModel mj_objectWithKeyValues:dic];
  233 + if (iconModel.holidayTheme) {
  234 + CNEditAppIconDetailModel *iconDetailModel = iconModel.holidayTheme;
  235 + NSString *loadUrl = [NSString stringWithFormat:@"%@",iconDetailModel.ios_imagePackage];
  236 + imagePath = [[CNLiveWebZipManager sharedInstance] getNewImagePathWithLoadUrl:loadUrl name:name key:key];
  237 +
  238 + }
  239 + }
  240 +
  241 + return imagePath;
  242 +
  243 +}
182 244  
183 245 /*** 取得旧数据路径图片 ***/
184 246 + (NSString *)getPathWithKey:(NSString *)key {
... ...
CNLiveBaseTools/Classes/TabBarEditIcon/WebLoadAndZip/CNLiveWebZipManager.h
... ... @@ -32,6 +32,8 @@ typedef void (^UnZipResultBlock)(Boolean isSuccess,NSString *hostPath, NSArray *
32 32  
33 33 /*** 根据图片key生成对应路径 ***/
34 34 - (NSString *)getImagePathWithLoadUrl:(NSString *)loadUrl name:(NSString *)name key:(NSString *)key;
  35 +/*** 新的根据图片key生成对应路径 ***/
  36 +- (NSString *)getNewImagePathWithLoadUrl:(NSString *)loadUrl name:(NSString *)name key:(NSString *)key;
35 37  
36 38 /*** 删除指定解压文件目录下文件 ***/
37 39 - (void)removeZipSuccessFile;
... ...
CNLiveBaseTools/Classes/TabBarEditIcon/WebLoadAndZip/CNLiveWebZipManager.m
... ... @@ -113,9 +113,8 @@ static CNLiveWebZipManager *_instance = nil;
113 113 return NO;
114 114 }
115 115 }
116   -
117   -/*** 根据图片key生成对应路径 ***/
118   -- (NSString *)getImagePathWithLoadUrl:(NSString *)loadUrl name:(NSString *)name key:(NSString *)key{
  116 +/*** 新的根据图片key生成对应路径 ***/
  117 +- (NSString *)getNewImagePathWithLoadUrl:(NSString *)loadUrl name:(NSString *)name key:(NSString *)key{
119 118  
120 119  
121 120  
... ... @@ -126,6 +125,59 @@ static CNLiveWebZipManager *_instance = nil;
126 125 if ([self directoryExists:urlCachePath]) {//看key路径目录下是否有文件
127 126 NSArray *urlCacheFiles = [self fileList:urlCachePath];
128 127 if (urlCacheFiles && urlCacheFiles.count > 0) {
  128 + //一级文件夹名字
  129 + NSString *fileName = [NSString stringWithFormat:@"%@",urlCacheFiles[0]];
  130 +
  131 + [urlCacheFiles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  132 + NSString *file = [NSString stringWithFormat:@"%@",obj];
  133 +
  134 + if ([file isEqualToString:fileName]) {//去指定zip目录
  135 +
  136 + NSString *nextPath = [urlCachePath stringByAppendingPathComponent:file];//添加指定目录
  137 + NSArray *nextCacheFiles = [self fileList:nextPath];
  138 + if (nextCacheFiles && nextCacheFiles.count > 0) {
  139 +
  140 + [nextCacheFiles enumerateObjectsUsingBlock:^(NSString * thirdFilename, NSUInteger idx, BOOL * _Nonnull stop) {
  141 + if ([thirdFilename isEqualToString:name]) {
  142 + NSString *thirdPath = [nextPath stringByAppendingPathComponent:thirdFilename];//添加指定目录
  143 + NSArray *thirdPathArr = [self fileList:thirdPath];
  144 + if (thirdPathArr && thirdPathArr.count >0) {
  145 + [thirdPathArr enumerateObjectsUsingBlock:^(NSString * obj, NSUInteger idx, BOOL * _Nonnull stop) {
  146 + NSString *imageName = [NSString stringWithFormat:@"%@",obj];
  147 +
  148 + if ([imageName hasPrefix:key]) {//和key相同
  149 + imagePath = [thirdPath stringByAppendingPathComponent:imageName];
  150 + return;
  151 + }
  152 + }];
  153 + }
  154 +
  155 + }
  156 +
  157 +
  158 + }];
  159 +
  160 + }
  161 + }
  162 +
  163 + }];
  164 +
  165 + }
  166 + }
  167 +
  168 + return imagePath;
  169 +
  170 +}
  171 +
  172 +/*** 根据图片key生成对应路径 (预防需求变更暂时保留之前皮肤逻辑)***/
  173 +- (NSString *)getImagePathWithLoadUrl:(NSString *)loadUrl name:(NSString *)name key:(NSString *)key{
  174 + __block NSString *imagePath = @"";
  175 +
  176 + NSString *urlCachePath = [self.cachesPath stringByAppendingPathComponent:[loadUrl md5]];
  177 +
  178 + if ([self directoryExists:urlCachePath]) {//看key路径目录下是否有文件
  179 + NSArray *urlCacheFiles = [self fileList:urlCachePath];
  180 + if (urlCacheFiles && urlCacheFiles.count > 0) {
129 181  
130 182 if (!name || name.length == 0) {
131 183 name = [NSString stringWithFormat:@"%@",urlCacheFiles[0]];
... ...
Example/CNLiveBaseTools.xcodeproj/project.pbxproj
... ... @@ -355,29 +355,51 @@
355 355 );
356 356 inputPaths = (
357 357 "${PODS_ROOT}/Target Support Files/Pods-CNLiveBaseTools_Example/Pods-CNLiveBaseTools_Example-frameworks.sh",
  358 + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
358 359 "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework",
359 360 "${BUILT_PRODUCTS_DIR}/CNLiveBaseTools/CNLiveBaseTools.framework",
360 361 "${BUILT_PRODUCTS_DIR}/CNLiveBeeHive/CNLiveBeeHive.framework",
  362 + "${BUILT_PRODUCTS_DIR}/CNLiveBusinessTools/CNLiveBusinessTools.framework",
  363 + "${BUILT_PRODUCTS_DIR}/CNLiveEnvironment/CNLiveEnvironment.framework",
361 364 "${BUILT_PRODUCTS_DIR}/CNLiveNewTripartiteManagement/CNLiveNewTripartiteManagement.framework",
  365 + "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework",
  366 + "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework",
362 367 "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
363 368 "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework",
364 369 "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
365 370 "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
  371 + "${BUILT_PRODUCTS_DIR}/YYAsyncLayer/YYAsyncLayer.framework",
  372 + "${BUILT_PRODUCTS_DIR}/YYCache/YYCache.framework",
366 373 "${BUILT_PRODUCTS_DIR}/YYCategories/YYCategories.framework",
  374 + "${BUILT_PRODUCTS_DIR}/YYDispatchQueuePool/YYDispatchQueuePool.framework",
367 375 "${BUILT_PRODUCTS_DIR}/YYImage/YYImage.framework",
  376 + "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework",
  377 + "${BUILT_PRODUCTS_DIR}/YYText/YYText.framework",
  378 + "${BUILT_PRODUCTS_DIR}/YYWebImage/YYWebImage.framework",
368 379 );
369 380 name = "[CP] Embed Pods Frameworks";
370 381 outputPaths = (
  382 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
371 383 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework",
372 384 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseTools.framework",
373 385 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBeeHive.framework",
  386 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBusinessTools.framework",
  387 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveEnvironment.framework",
374 388 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveNewTripartiteManagement.framework",
  389 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework",
  390 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework",
375 391 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
376 392 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework",
377 393 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
378 394 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
  395 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYAsyncLayer.framework",
  396 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCache.framework",
379 397 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYCategories.framework",
  398 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYDispatchQueuePool.framework",
380 399 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYImage.framework",
  400 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework",
  401 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYText.framework",
  402 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYWebImage.framework",
381 403 );
382 404 runOnlyForDeploymentPostprocessing = 0;
383 405 shellPath = /bin/sh;
... ...
Example/CNLiveBaseTools/CNLiveAppDelegate.m
... ... @@ -7,15 +7,49 @@
7 7 //
8 8  
9 9 #import "CNLiveAppDelegate.h"
  10 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  11 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  12 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  13 +#import "CNLiveEditAppIconManager.h"
10 14  
11 15 @implementation CNLiveAppDelegate
12 16  
13 17 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 18 {
15 19 // Override point for customization after application launch.
  20 + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore isNewHomePage:YES];
  21 + [CNUserInfoManager manager].userInfoModel.uid = @"11174272";
  22 + [CNLiveEditAppIconManager iconMsgNewReplaceOld];
  23 + [self setParamNet];
16 24 return YES;
17 25 }
  26 +-(void)setParamNet
  27 +{
  28 + //网家家网络请求参数
  29 + NSMutableDictionary * mDict = [[NSMutableDictionary alloc] init];
  30 + [mDict setValue:[CNUserInfoManager manager].userInfoModel.uid forKey:@"loginSid"];
  31 + [mDict setValue:@"com.cnlive.CNLiveNetAdd.debug" forKey:@"platform_id"];
  32 + [mDict setValue:[[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""] forKey:@"uuid"];
  33 + [mDict setValue:@"i" forKey:@"plat"];
  34 + [mDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"ver"];
  35 + [mDict setObject:AppId forKey:@"appId"];
  36 + [mDict setObject:[CNUserInfoManager manager].userInfoModel.uid forKey:@"sid"];
  37 + [CNLiveNetworking setupDefaultParam:mDict];
  38 +
  39 + //电商网络请求参数
  40 + NSMutableDictionary * dsDict = [[NSMutableDictionary alloc] init];
  41 + [dsDict setValue:@"iPhone" forKey:@"Phone-Model"];
  42 + [dsDict setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] forKey:@"Version"];
  43 + [dsDict setValue:CNUserShareModel.uid forKey:@"Uid"];
  44 + [dsDict setValue:@"0.6.2" forKey:@"Shop-Version"];
  45 + [CNLiveNetworking setupDSShopParam:dsDict];
  46 +
18 47  
  48 + [CNLiveNetworking setupShowResult:NO];
  49 + [CNLiveNetworking setupSignKey:APPKey];
  50 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  51 + [CNLiveNetworking setResponseSerializerType:CNLiveResponseSerializerJSON];
  52 +}
19 53 - (void)applicationWillResignActive:(UIApplication *)application
20 54 {
21 55 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
... ...
Example/CNLiveBaseTools/CNLiveBaseTools-Info.plist
... ... @@ -4,6 +4,11 @@
4 4 <dict>
5 5 <key>CFBundleDevelopmentRegion</key>
6 6 <string>en</string>
  7 + <key>NSAppTransportSecurity</key>
  8 + <dict>
  9 + <key>NSAllowsArbitraryLoads</key>
  10 + <true/>
  11 + </dict>
7 12 <key>CFBundleDisplayName</key>
8 13 <string>${PRODUCT_NAME}</string>
9 14 <key>CFBundleExecutable</key>
... ...
Example/CNLiveBaseTools/CNLiveViewController.m
... ... @@ -7,6 +7,15 @@
7 7 //
8 8  
9 9 #import "CNLiveViewController.h"
  10 +#import <CNLiveBaseTools/CNLiveBaseTools.h>
  11 +#import <CNLiveBaseTools/NSString+CNEditIcon.h>
  12 +#import <CNLiveEditAppIconManager.h>
  13 +#import <CNLiveBusinessTools/HttpService.h>
  14 +#import <CNLiveEnvironment/CNLiveEnvironment.h>
  15 +#import <CNLiveBaseKit/CNLiveBaseKit.h>
  16 +#import <YYCategories/NSDictionary+YYAdd.h>
  17 +#import <CNLiveUserManagement/CNUserInfoManager.h>
  18 +
10 19  
11 20 @interface CNLiveViewController ()
12 21  
... ... @@ -17,9 +26,47 @@
17 26 - (void)viewDidLoad
18 27 {
19 28 [super viewDidLoad];
  29 + NSDictionary *params = @{
  30 + @"appId":AppId,
  31 + @"sid":CNLiveStringIsEmpty(CNUserShareModel.uid)?@"":CNUserShareModel.uid,
  32 + @"plat":@"i",
  33 + @"deviceType":@"IOS",
  34 + @"type":@"C",
  35 + @"app_channel_id":@""
  36 + };
  37 + [[HttpService service] sendRequestWithHttpMethod:E_HTTP_REQUEST_METHOD_POST URLPath:CNGetCommonMsgUrl parameters:params isCache:NO CheckParam:nil completionHandler:^(id data, NSError *error) {
  38 +
  39 + #pragma mark - 加入皮肤
  40 + if (data) {
  41 + NSDictionary *dic = (NSDictionary *)data;
  42 + if ([dic containsObjectForKey:kHolidayThemeMap]) {
  43 + NSDictionary *holidayDic = [dic objectForKey:kHolidayThemeMap];
  44 + if (holidayDic) {//获取数据,参数为空,保持原有旧和新存入数据
  45 +
  46 +
  47 +
  48 + /*** 存入新参数 ***/
  49 + [CNLiveEditAppIconManager editNewiconMsgWithDic:holidayDic];
  50 + /*** 下载 ***/
  51 + [CNLiveEditAppIconManager startDownLoadZip];
  52 +
  53 + }
  54 +
  55 + }
  56 + }
  57 +
  58 + }];
  59 +
  60 + UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(20, 100, 60, 44)];
  61 + btn.backgroundColor = [UIColor redColor];
  62 + [btn addTarget:self action:@selector(actionWithSender:) forControlEvents:UIControlEventTouchUpInside];
  63 + [self.view addSubview:btn];
20 64 // Do any additional setup after loading the view, typically from a nib.
21 65 }
22   -
  66 +- (void )actionWithSender:(UIButton *)sender{
  67 + NSString *str = [NSString getEditIconWithName:@"courtyard" key:@"courtyard_guide_food"];
  68 + NSLog(@"+++%@",str);
  69 +}
23 70 - (void)didReceiveMemoryWarning
24 71 {
25 72 [super didReceiveMemoryWarning];
... ...
Example/Podfile
... ... @@ -5,7 +5,7 @@ source &#39;http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git&#39;
5 5 source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
6 6 target 'CNLiveBaseTools_Example' do
7 7 pod 'CNLiveBaseTools', :path => '../'
8   -
  8 +pod 'CNLiveBusinessTools'
9 9 target 'CNLiveBaseTools_Tests' do
10 10 inherit! :search_paths
11 11  
... ...
Example/Podfile.lock
1 1 PODS:
  2 + - AFNetworking (4.0.1):
  3 + - AFNetworking/NSURLSession (= 4.0.1)
  4 + - AFNetworking/Reachability (= 4.0.1)
  5 + - AFNetworking/Security (= 4.0.1)
  6 + - AFNetworking/Serialization (= 4.0.1)
  7 + - AFNetworking/UIKit (= 4.0.1)
  8 + - AFNetworking/NSURLSession (4.0.1):
  9 + - AFNetworking/Reachability
  10 + - AFNetworking/Security
  11 + - AFNetworking/Serialization
  12 + - AFNetworking/Reachability (4.0.1)
  13 + - AFNetworking/Security (4.0.1)
  14 + - AFNetworking/Serialization (4.0.1)
  15 + - AFNetworking/UIKit (4.0.1):
  16 + - AFNetworking/NSURLSession
2 17 - CNLiveBaseKit (0.1.23):
3 18 - CNLiveNewTripartiteManagement/MJExtension
4   - - CNLiveBaseTools (0.0.3):
  19 + - CNLiveBaseTools (0.0.4):
5 20 - CNLiveBaseKit
6 21 - CNLiveBeeHive
7 22 - CNLiveNewTripartiteManagement/QMUIKit
... ... @@ -10,6 +25,21 @@ PODS:
10 25 - CNLiveNewTripartiteManagement/YYCategories
11 26 - CNLiveNewTripartiteManagement/YYImage
12 27 - CNLiveBeeHive (0.1.9)
  28 + - CNLiveBusinessTools (0.1.32):
  29 + - CNLiveBaseKit
  30 + - CNLiveEnvironment
  31 + - CNLiveNewTripartiteManagement/QMUIKit
  32 + - CNLiveNewTripartiteManagement/YYAsyncLayer
  33 + - CNLiveNewTripartiteManagement/YYCache
  34 + - CNLiveNewTripartiteManagement/YYCategories
  35 + - CNLiveNewTripartiteManagement/YYDispatchQueuePool
  36 + - CNLiveNewTripartiteManagement/YYImage
  37 + - CNLiveNewTripartiteManagement/YYModel
  38 + - CNLiveNewTripartiteManagement/YYText
  39 + - CNLiveNewTripartiteManagement/YYWebImage
  40 + - CNLiveRequestBastKit
  41 + - CNLiveUserManagement
  42 + - CNLiveEnvironment (0.4.8)
13 43 - CNLiveNewTripartiteManagement/MJExtension (0.2.0.6):
14 44 - MJExtension (= 3.2.1)
15 45 - CNLiveNewTripartiteManagement/QMUIKit (0.2.0.6):
... ... @@ -18,10 +48,26 @@ PODS:
18 48 - SDWebImage (= 5.2.3)
19 49 - CNLiveNewTripartiteManagement/SSZipArchive (0.2.0.6):
20 50 - SSZipArchive (= 2.1.5)
  51 + - CNLiveNewTripartiteManagement/YYAsyncLayer (0.2.0.9):
  52 + - YYAsyncLayer (= 1.0)
  53 + - CNLiveNewTripartiteManagement/YYCache (0.2.0.9):
  54 + - YYCache (= 1.0.4)
21 55 - CNLiveNewTripartiteManagement/YYCategories (0.2.0.6):
22 56 - YYCategories (= 1.0.4)
  57 + - CNLiveNewTripartiteManagement/YYDispatchQueuePool (0.2.0.9):
  58 + - YYDispatchQueuePool (= 1.0)
23 59 - CNLiveNewTripartiteManagement/YYImage (0.2.0.6):
24 60 - YYImage (= 1.0.4)
  61 + - CNLiveNewTripartiteManagement/YYModel (0.2.0.9):
  62 + - YYModel (= 1.0.4)
  63 + - CNLiveNewTripartiteManagement/YYText (0.2.0.9):
  64 + - YYText (= 1.0.7)
  65 + - CNLiveNewTripartiteManagement/YYWebImage (0.2.0.9):
  66 + - YYWebImage (= 1.0.5)
  67 + - CNLiveRequestBastKit (0.2.6.0):
  68 + - AFNetworking
  69 + - CNLiveUserManagement (0.1.5):
  70 + - CNLiveNewTripartiteManagement/MJExtension
25 71 - MJExtension (3.2.1)
26 72 - QMUIKit (4.2.1):
27 73 - QMUIKit/QMUIComponents (= 4.2.1)
... ... @@ -344,45 +390,76 @@ PODS:
344 390 - SDWebImage/Core (= 5.2.3)
345 391 - SDWebImage/Core (5.2.3)
346 392 - SSZipArchive (2.1.5)
  393 + - YYAsyncLayer (1.0)
  394 + - YYCache (1.0.4)
347 395 - YYCategories (1.0.4):
348 396 - YYCategories/no-arc (= 1.0.4)
349 397 - YYCategories/no-arc (1.0.4)
  398 + - YYDispatchQueuePool (1.0)
350 399 - YYImage (1.0.4):
351 400 - YYImage/Core (= 1.0.4)
352 401 - YYImage/Core (1.0.4)
  402 + - YYModel (1.0.4)
  403 + - YYText (1.0.7)
  404 + - YYWebImage (1.0.5):
  405 + - YYCache
  406 + - YYImage
353 407  
354 408 DEPENDENCIES:
355 409 - CNLiveBaseTools (from `../`)
  410 + - CNLiveBusinessTools
356 411  
357 412 SPEC REPOS:
358 413 http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git:
359 414 - CNLiveBaseKit
360 415 - CNLiveBeeHive
  416 + - CNLiveBusinessTools
  417 + - CNLiveEnvironment
361 418 - CNLiveNewTripartiteManagement
  419 + - CNLiveRequestBastKit
  420 + - CNLiveUserManagement
362 421 https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
  422 + - AFNetworking
363 423 - MJExtension
364 424 - QMUIKit
365 425 - SDWebImage
366 426 - SSZipArchive
  427 + - YYAsyncLayer
  428 + - YYCache
367 429 - YYCategories
  430 + - YYDispatchQueuePool
368 431 - YYImage
  432 + - YYModel
  433 + - YYText
  434 + - YYWebImage
369 435  
370 436 EXTERNAL SOURCES:
371 437 CNLiveBaseTools:
372 438 :path: "../"
373 439  
374 440 SPEC CHECKSUMS:
  441 + AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
375 442 CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807
376   - CNLiveBaseTools: 0b0d61d114cc5feceba079a732debb13190b1249
  443 + CNLiveBaseTools: 6f04a3c0e0df7d116bcbd3c228c676d6cf364e5e
377 444 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4
378   - CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa
  445 + CNLiveBusinessTools: 67358bb3f6e914ee32b8572cc2fdf0122ad95094
  446 + CNLiveEnvironment: 1705c4fe1b0fd4ee3c6b0c5b9717008f4d80cc1d
  447 + CNLiveNewTripartiteManagement: 7fb07741462b67e290997f80efc42a3df47049bc
  448 + CNLiveRequestBastKit: ef3ebe292acaf2922189ea8b46cc8a9ef48b0b33
  449 + CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf
379 450 MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
380 451 QMUIKit: 15294d6a350466e4a6f4df0333eac5bff474f995
381 452 SDWebImage: 46a7f73228f84ce80990c786e4372cf4db5875ce
382 453 SSZipArchive: cefe1364104a0231268a5deb8495bdf2861f52f0
  454 + YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0
  455 + YYCache: 8105b6638f5e849296c71f331ff83891a4942952
383 456 YYCategories: 6bcd4314c6661a561410dce4a793379ebd306abd
  457 + YYDispatchQueuePool: 3dfb2274bcc74207688dde8ac6f7bdd46871dd7b
384 458 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
  459 + YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
  460 + YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
  461 + YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
385 462  
386   -PODFILE CHECKSUM: c83e68c17422a4178ce600c26b1d6a3234b90a8c
  463 +PODFILE CHECKSUM: d69984180a7a5fcb169b5e783cf7575486a9a579
387 464  
388   -COCOAPODS: 1.11.2
  465 +COCOAPODS: 1.11.3
... ...
Example/Pods/Local Podspecs/CNLiveBaseTools.podspec.json
1 1 {
2 2 "name": "CNLiveBaseTools",
3   - "version": "0.0.3",
  3 + "version": "0.0.4",
4 4 "summary": "基础工具库时间声音等工具",
5 5 "description": "TODO: Add long description of the pod here.",
6 6 "homepage": "http://bj.gitlab.cnlive.com/ios-team/CNLiveBaseTools",
... ... @@ -13,7 +13,7 @@
13 13 },
14 14 "source": {
15 15 "git": "http://bj.gitlab.cnlive.com/ios-team/CNLiveBaseTools.git",
16   - "tag": "0.0.3"
  16 + "tag": "0.0.4"
17 17 },
18 18 "platforms": {
19 19 "ios": "10.0"
... ...
Example/Pods/Manifest.lock
1 1 PODS:
  2 + - AFNetworking (4.0.1):
  3 + - AFNetworking/NSURLSession (= 4.0.1)
  4 + - AFNetworking/Reachability (= 4.0.1)
  5 + - AFNetworking/Security (= 4.0.1)
  6 + - AFNetworking/Serialization (= 4.0.1)
  7 + - AFNetworking/UIKit (= 4.0.1)
  8 + - AFNetworking/NSURLSession (4.0.1):
  9 + - AFNetworking/Reachability
  10 + - AFNetworking/Security
  11 + - AFNetworking/Serialization
  12 + - AFNetworking/Reachability (4.0.1)
  13 + - AFNetworking/Security (4.0.1)
  14 + - AFNetworking/Serialization (4.0.1)
  15 + - AFNetworking/UIKit (4.0.1):
  16 + - AFNetworking/NSURLSession
2 17 - CNLiveBaseKit (0.1.23):
3 18 - CNLiveNewTripartiteManagement/MJExtension
4   - - CNLiveBaseTools (0.0.3):
  19 + - CNLiveBaseTools (0.0.4):
5 20 - CNLiveBaseKit
6 21 - CNLiveBeeHive
7 22 - CNLiveNewTripartiteManagement/QMUIKit
... ... @@ -10,6 +25,21 @@ PODS:
10 25 - CNLiveNewTripartiteManagement/YYCategories
11 26 - CNLiveNewTripartiteManagement/YYImage
12 27 - CNLiveBeeHive (0.1.9)
  28 + - CNLiveBusinessTools (0.1.32):
  29 + - CNLiveBaseKit
  30 + - CNLiveEnvironment
  31 + - CNLiveNewTripartiteManagement/QMUIKit
  32 + - CNLiveNewTripartiteManagement/YYAsyncLayer
  33 + - CNLiveNewTripartiteManagement/YYCache
  34 + - CNLiveNewTripartiteManagement/YYCategories
  35 + - CNLiveNewTripartiteManagement/YYDispatchQueuePool
  36 + - CNLiveNewTripartiteManagement/YYImage
  37 + - CNLiveNewTripartiteManagement/YYModel
  38 + - CNLiveNewTripartiteManagement/YYText
  39 + - CNLiveNewTripartiteManagement/YYWebImage
  40 + - CNLiveRequestBastKit
  41 + - CNLiveUserManagement
  42 + - CNLiveEnvironment (0.4.8)
13 43 - CNLiveNewTripartiteManagement/MJExtension (0.2.0.6):
14 44 - MJExtension (= 3.2.1)
15 45 - CNLiveNewTripartiteManagement/QMUIKit (0.2.0.6):
... ... @@ -18,10 +48,26 @@ PODS:
18 48 - SDWebImage (= 5.2.3)
19 49 - CNLiveNewTripartiteManagement/SSZipArchive (0.2.0.6):
20 50 - SSZipArchive (= 2.1.5)
  51 + - CNLiveNewTripartiteManagement/YYAsyncLayer (0.2.0.9):
  52 + - YYAsyncLayer (= 1.0)
  53 + - CNLiveNewTripartiteManagement/YYCache (0.2.0.9):
  54 + - YYCache (= 1.0.4)
21 55 - CNLiveNewTripartiteManagement/YYCategories (0.2.0.6):
22 56 - YYCategories (= 1.0.4)
  57 + - CNLiveNewTripartiteManagement/YYDispatchQueuePool (0.2.0.9):
  58 + - YYDispatchQueuePool (= 1.0)
23 59 - CNLiveNewTripartiteManagement/YYImage (0.2.0.6):
24 60 - YYImage (= 1.0.4)
  61 + - CNLiveNewTripartiteManagement/YYModel (0.2.0.9):
  62 + - YYModel (= 1.0.4)
  63 + - CNLiveNewTripartiteManagement/YYText (0.2.0.9):
  64 + - YYText (= 1.0.7)
  65 + - CNLiveNewTripartiteManagement/YYWebImage (0.2.0.9):
  66 + - YYWebImage (= 1.0.5)
  67 + - CNLiveRequestBastKit (0.2.6.0):
  68 + - AFNetworking
  69 + - CNLiveUserManagement (0.1.5):
  70 + - CNLiveNewTripartiteManagement/MJExtension
25 71 - MJExtension (3.2.1)
26 72 - QMUIKit (4.2.1):
27 73 - QMUIKit/QMUIComponents (= 4.2.1)
... ... @@ -344,45 +390,76 @@ PODS:
344 390 - SDWebImage/Core (= 5.2.3)
345 391 - SDWebImage/Core (5.2.3)
346 392 - SSZipArchive (2.1.5)
  393 + - YYAsyncLayer (1.0)
  394 + - YYCache (1.0.4)
347 395 - YYCategories (1.0.4):
348 396 - YYCategories/no-arc (= 1.0.4)
349 397 - YYCategories/no-arc (1.0.4)
  398 + - YYDispatchQueuePool (1.0)
350 399 - YYImage (1.0.4):
351 400 - YYImage/Core (= 1.0.4)
352 401 - YYImage/Core (1.0.4)
  402 + - YYModel (1.0.4)
  403 + - YYText (1.0.7)
  404 + - YYWebImage (1.0.5):
  405 + - YYCache
  406 + - YYImage
353 407  
354 408 DEPENDENCIES:
355 409 - CNLiveBaseTools (from `../`)
  410 + - CNLiveBusinessTools
356 411  
357 412 SPEC REPOS:
358 413 http://bj.gitlab.cnlive.com/ios-team/CNLiveRepos.git:
359 414 - CNLiveBaseKit
360 415 - CNLiveBeeHive
  416 + - CNLiveBusinessTools
  417 + - CNLiveEnvironment
361 418 - CNLiveNewTripartiteManagement
  419 + - CNLiveRequestBastKit
  420 + - CNLiveUserManagement
362 421 https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
  422 + - AFNetworking
363 423 - MJExtension
364 424 - QMUIKit
365 425 - SDWebImage
366 426 - SSZipArchive
  427 + - YYAsyncLayer
  428 + - YYCache
367 429 - YYCategories
  430 + - YYDispatchQueuePool
368 431 - YYImage
  432 + - YYModel
  433 + - YYText
  434 + - YYWebImage
369 435  
370 436 EXTERNAL SOURCES:
371 437 CNLiveBaseTools:
372 438 :path: "../"
373 439  
374 440 SPEC CHECKSUMS:
  441 + AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
375 442 CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807
376   - CNLiveBaseTools: 0b0d61d114cc5feceba079a732debb13190b1249
  443 + CNLiveBaseTools: 6f04a3c0e0df7d116bcbd3c228c676d6cf364e5e
377 444 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4
378   - CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa
  445 + CNLiveBusinessTools: 67358bb3f6e914ee32b8572cc2fdf0122ad95094
  446 + CNLiveEnvironment: 1705c4fe1b0fd4ee3c6b0c5b9717008f4d80cc1d
  447 + CNLiveNewTripartiteManagement: 7fb07741462b67e290997f80efc42a3df47049bc
  448 + CNLiveRequestBastKit: ef3ebe292acaf2922189ea8b46cc8a9ef48b0b33
  449 + CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf
379 450 MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
380 451 QMUIKit: 15294d6a350466e4a6f4df0333eac5bff474f995
381 452 SDWebImage: 46a7f73228f84ce80990c786e4372cf4db5875ce
382 453 SSZipArchive: cefe1364104a0231268a5deb8495bdf2861f52f0
  454 + YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0
  455 + YYCache: 8105b6638f5e849296c71f331ff83891a4942952
383 456 YYCategories: 6bcd4314c6661a561410dce4a793379ebd306abd
  457 + YYDispatchQueuePool: 3dfb2274bcc74207688dde8ac6f7bdd46871dd7b
384 458 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
  459 + YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
  460 + YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
  461 + YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
385 462  
386   -PODFILE CHECKSUM: c83e68c17422a4178ce600c26b1d6a3234b90a8c
  463 +PODFILE CHECKSUM: d69984180a7a5fcb169b5e783cf7575486a9a579
387 464  
388   -COCOAPODS: 1.11.2
  465 +COCOAPODS: 1.11.3
... ...