Commit 2d35e7ecdc57d36a7c4528d5a0831377f9334186

Authored by yanglingyu
1 parent a31384b7

新建换肤文件夹

CNLiveBaseTools/Classes/TabBarEditIcon/NSString+CNEditIcon.h 0 → 100644
  1 +//
  2 +// NSString+CNEditIcon.h
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by iOS on 2022/11/3.
  6 +// Copyright © 2022 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +NS_ASSUME_NONNULL_BEGIN
  12 +
  13 +@interface NSString (CNEditIcon)
  14 +/// 获取图片1 - 默认,获取图片2 - 本地图片,获取图片3 - 网络图片
  15 ++ (NSString *)getEditIconWithName:(NSString *)name key:(NSString *)key;
  16 +@end
  17 +
  18 +NS_ASSUME_NONNULL_END
CNLiveBaseTools/Classes/TabBarEditIcon/NSString+CNEditIcon.m 0 → 100644
  1 +//
  2 +// NSString+CNEditIcon.m
  3 +// CNLiveNetAdd
  4 +//
  5 +// Created by iOS on 2022/11/3.
  6 +// Copyright © 2022 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "NSString+CNEditIcon.h"
  10 +#import "CNLiveEditAppIconManager.h"
  11 +
  12 +@implementation NSString (CNEditIcon)
  13 +/// 获取图片1 - 默认,获取图片2 - 本地图片,获取图片3 - 网络图片
  14 ++ (NSString *)getEditIconWithName:(NSString *)name key:(NSString *)key{
  15 + /**########################### 下面是换肤逻辑 ################################*/
  16 +
  17 + /*** 默认 ***/
  18 + EditAppIconStatus status = [CNLiveEditAppIconManager getEditAppIconStatus];
  19 +
  20 + if (status == EditAppIconStatusNet) {
  21 +
  22 + DownLoadAppIconStatus downloadStatus = [CNLiveEditAppIconManager editNetAppIconDownloadWithKey:kHolidayKey];
  23 + if (downloadStatus == EditAppIconStatusSucess) {//下载成功
  24 + NSString *imagePath = [CNLiveEditAppIconManager getPathWithName:name key:key];
  25 +
  26 + if (imagePath && imagePath.length > 0) {
  27 + return imagePath;
  28 + }
  29 + }
  30 + }
  31 +
  32 + return nil;
  33 +}
  34 +@end