Commit 1a9d4271c2179d88b3db5b170f27bc6b1c5eb1da

Authored by zhangxiaowen
1 parent 31b90639

no message

CNLiveGifFace.podspec
... ... @@ -9,7 +9,7 @@
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveGifFace'
11 11 s.version = '0.0.1'
12   - s.summary = 'A short description of CNLiveGifFace.'
  12 + s.summary = 'GIF表情.'
13 13  
14 14 # This description is used to generate tags and improve search results.
15 15 # * Think: What does it do? Why did you write it? What is the focus?
... ... @@ -48,5 +48,8 @@ TODO: Add long description of the pod here.
48 48 s.dependency 'CNLiveCustomUI'
49 49 s.dependency 'WebViewJavascriptBridge'
50 50 s.dependency 'SSZipArchive'
  51 + s.dependency 'CNLiveCommonCategory'
  52 + s.dependency 'CNLiveCommonClass'
  53 + s.dependency 'IMBaseSDK'
51 54  
52 55 end
... ...
CNLiveGifFace/Classes/Controller/CNChatGifDetailsViewController.h
... ... @@ -8,6 +8,9 @@
8 8  
9 9 #import "CNCommonViewController.h"
10 10 #import "CNChatViewController.h"
  11 +#import "TIMAdapter.h"
  12 +#import "CommonLibrary.h"
  13 +
11 14 NS_ASSUME_NONNULL_BEGIN
12 15  
13 16 @interface CNChatGifDetailsViewController : CNCommonViewController
... ...
CNLiveGifFace/Classes/Controller/CNChatGifDetailsViewController.m
... ... @@ -15,6 +15,11 @@
15 15 #import "CNMessageForwardingController.h"
16 16 #import "CNGifFaceModel.h"
17 17  
  18 +#import "CNLiveDefinesHeader.h"
  19 +#import <QMUIKit/QMUIKit.h>
  20 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
  21 +#import <YYKit/YYKit.h>
  22 +
18 23 @interface CNChatGifDetailsViewController ()<UIGestureRecognizerDelegate>
19 24 @property (nonatomic, strong) YYAnimatedImageView *webImageView;
20 25 @property (nonatomic, strong) UILabel *nameLabel;
... ...
CNLiveGifFace/Classes/Controller/CNGifFaceListViewController.m
... ... @@ -14,10 +14,13 @@
14 14 #import "CNLiveDownLoadManager.h"
15 15 #import "CNLiveArchiveManager.h"
16 16 #import <AFNetworking/AFNetworking.h>
17   -#import "CNUserAgreementRequst.h"
18   -#import "CNReportAndComplaintWebController.h"
  17 +//#import "CNUserAgreementRequst.h"
  18 +//#import "CNReportAndComplaintWebController.h"
19 19 #import "UIColor+CNLiveExtension.h"
20   -#import "CNNavigationController.h"
  20 +//#import "CNNavigationController.h"
  21 +#import <QMUIKit/QMUIKit.h>
  22 +#import "CNUserInfoManager.h"
  23 +#import "CNLiveDefinesHeader.h"
21 24  
22 25 @interface CNGifFaceListViewController ()<UITableViewDelegate, UITableViewDataSource, CNGifFaceListTableViewCellDelegate>{
23 26 BOOL _isDownload;
... ...
CNLiveGifFace/Classes/Controller/CNMyGifFaceViewController.m
... ... @@ -10,7 +10,10 @@
10 10 #import "CNGifFaceListHeaderView.h"
11 11 #import "CNMyGifFaceTableViewCell.h"
12 12 #import "CNGifFaceModel.h"
13   -
  13 +#import "Masonry.h"
  14 +#import "MJExtension.h"
  15 +#import "CNLiveDefinesHeader.h"
  16 +#import "CNUserInfoManager.h"
14 17  
15 18 @interface CNMyGifFaceViewController ()<UITableViewDelegate,UITableViewDataSource,CNMyGifFaceTableViewCellDelegate>
16 19 @property (nonatomic, strong) UITableView *tableView;
... ... @@ -145,7 +148,7 @@
145 148 _data = [[NSMutableArray alloc] init];
146 149 NSFileManager *fileManager = [NSFileManager defaultManager];
147 150 NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
148   - NSString *filePath = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/%@",[UserInformationModel manager].uid,@"GifFaceList.plist"]];
  151 + NSString *filePath = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/%@",CNUserShareModelUid,@"GifFaceList.plist"]];
149 152 ///var/mobile/Containers/Data/Application/94E0C70B-9F4D-4716-8EAF-7BF0C53AEAEE/Documents/10514405/GifFace/GifFaceList.plist
150 153 BOOL result = [fileManager fileExistsAtPath:filePath];
151 154 if(result){
... ...
CNLiveGifFace/Classes/Tools/CNGifManager.m
... ... @@ -7,6 +7,8 @@
7 7 //
8 8  
9 9 #import "CNGifManager.h"
  10 +#import "CNUserInfoManager.h"
  11 +
10 12 #define timeInterval @(600)
11 13 #define tolerance @(0.01)
12 14  
... ... @@ -227,7 +229,7 @@ typedef NS_ENUM(NSInteger, GIFSize) {
227 229 + (NSString *)makingGIFforTimePoints:(NSArray *)timePoints fromURL:(NSURL *)url fileProperties:(NSDictionary *)fileProperties frameProperties:(NSDictionary *)frameProperties frameCount:(int)frameCount gifSize:(GIFSize)gifSize needCompression:(BOOL)isNeedCompression compressionWidth:(float)compressionWidth compressionHeight:(float)compressionHeight{
228 230  
229 231 NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
230   - NSString *filePath = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/DownLoad/Personal",[UserInformationModel manager].uid]];
  232 + NSString *filePath = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/DownLoad/Personal",[CNUserInfoManager manager].userInfoModel.uid]];
231 233  
232 234 NSFileManager *fileManager = [NSFileManager defaultManager];
233 235 BOOL result = [fileManager fileExistsAtPath:filePath];
... ...
CNLiveGifFace/Classes/View/CNGifFaceListHeaderView.m
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #import "CNGifFaceListHeaderView.h"
10 10 #import "UIColor+CNLiveExtension.h"
  11 +#import "CNLiveDefinesHeader.h"
11 12  
12 13 @interface CNGifFaceListHeaderView()
13 14 /** 内部的label */
... ... @@ -31,12 +32,12 @@ static const NSInteger margin = 10;
31 32 [self.contentView addSubview:label];
32 33 self.label = label;
33 34  
34   - UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, 0.5)];
  35 + UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 0.5)];
35 36 topLine.backgroundColor = CNLiveColorWithHexString(@"EBEBEB");
36 37 [self.contentView addSubview:topLine];
37 38 self.topLine = topLine;
38 39  
39   - UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(margin, 45*RATIO-0.5, kMainScreenWidth-margin, 0.5)];
  40 + UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(margin, 45*RATIO-0.5, KScreenWidth-margin, 0.5)];
40 41 bottomLine.backgroundColor = CNLiveColorWithHexString(@"EBEBEB");
41 42 [self.contentView addSubview:bottomLine];
42 43 self.bottomLine = bottomLine;
... ...
CNLiveGifFace/Classes/View/CNGifFaceListTableViewCell.m
... ... @@ -10,6 +10,11 @@
10 10 #import "CNGifFaceModel.h"
11 11 #import "UIColor+CNLiveExtension.h"
12 12 #import <AFNetworking/AFNetworking.h>
  13 +#import "UIImageView+WebCache.h"
  14 +#import "Masonry.h"
  15 +#import "CNLiveDefinesHeader.h"
  16 +#import <QMUIKit/QMUIKit.h>
  17 +#import <CNLiveRequestBastKit/CNLiveNetworking.h>
13 18  
14 19 @interface CNGifFaceListTableViewCell()
15 20 @property (nonatomic, strong) UIImageView *leftImage;
... ... @@ -144,15 +149,14 @@ static const NSInteger margin = 10;
144 149 }
145 150 #pragma mark - Action
146 151 - (void)clickAddBtn:(UIButton *)btn{
  152 + if(![CNLiveNetworking isNetworking]){
  153 + [QMUITips showWithText:@"无法连接网络" inView:[UIApplication sharedApplication].delegate.window hideAfterDelay:1];
  154 + return ;
  155 + }
  156 +
147 157 _addBtn.hidden = YES;
148 158 _processView.hidden = NO;
149 159  
150   - AFNetworkReachabilityManager *manager = [AFNetworkReachabilityManager sharedManager];
151   - if(manager.networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || manager.networkReachabilityStatus == AFNetworkReachabilityStatusUnknown){
152   - [QMUITips showWithText:@"无法连接网络" inView:AppKeyWindow hideAfterDelay:1];
153   - return;
154   - }
155   -
156 160 if (self.delegate && [self.delegate respondsToSelector:@selector(clickedAddBtn:)]) {
157 161 [self.delegate clickedAddBtn:self.model.downloadUrl];//滑动响应实现
158 162 }
... ...
CNLiveGifFace/Classes/View/CNMyGifFaceTableViewCell.m
... ... @@ -11,8 +11,13 @@
11 11 #import "CNGifFaceModel.h"
12 12 #import "CNLiveDownLoadManager.h"
13 13 #import "CNLiveArchiveManager.h"
14   -//#import "UIColor+CNLiveExtension.h"
  14 +#import "UIColor+CNLiveExtension.h"
15 15 #import "CNFaceThemeModel.h"
  16 +#import "Masonry.h"
  17 +#import "MJExtension.h"
  18 +#import "CNUserInfoManager.h"
  19 +#import "CNLiveDefinesHeader.h"
  20 +#import <QMUIKit/QMUIKit.h>
16 21  
17 22 @interface CNMyGifFaceTableViewCell()
18 23 @property (nonatomic, strong) UIImageView *leftImage;
... ... @@ -37,7 +42,7 @@ static const NSInteger margin = 10;
37 42 #pragma mark - Data
38 43 - (void)setGroupName:(NSString *)groupName{
39 44 _groupName = groupName;
40   - NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/Download/%@",[UserInformationModel manager].uid,groupName]];
  45 + NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/Download/%@",CNUserShareModelUid,groupName]];
41 46  
42 47 //设置图片
43 48 NSString *image = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_left0",groupName]];
... ... @@ -112,11 +117,11 @@ static const NSInteger margin = 10;
112 117  
113 118 #pragma mark - Action
114 119 - (void)clickRemoveBtn:(UIButton *)btn{
115   - [QMUITips showLoading:@"移除中..." inView:AppKeyWindow];
  120 + [QMUITips showLoading:@"移除中..." inView:[UIApplication sharedApplication].delegate.window];
116 121  
117 122 //1先删除plist文件
118 123 NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
119   - NSString *filePath1 = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/%@",[UserInformationModel manager].uid,@"GifFaceList.plist"]];
  124 + NSString *filePath1 = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/%@",CNUserShareModelUid,@"GifFaceList.plist"]];
120 125 ///var/mobile/Containers/Data/Application/94E0C70B-9F4D-4716-8EAF-7BF0C53AEAEE/Documents/10514405/GifFace/GifFaceList.plist
121 126 NSFileManager *fileManager = [NSFileManager defaultManager];
122 127 BOOL result1 = [fileManager fileExistsAtPath:filePath1];
... ... @@ -133,7 +138,7 @@ static const NSInteger margin = 10;
133 138  
134 139 }
135 140 //2然后删除文件夹中的表情包
136   - NSString *filePath2 = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/Download/%@",[UserInformationModel manager].uid,_groupName]];
  141 + NSString *filePath2 = [docPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@/GifFace/Download/%@",CNUserShareModelUid,_groupName]];
137 142 BOOL result2 = [fileManager fileExistsAtPath:filePath2];
138 143 if(result2){
139 144 //读取已存在的表情包列表
... ... @@ -147,7 +152,7 @@ static const NSInteger margin = 10;
147 152 [self.delegate refreshGifFaceTableView:self];
148 153 [[NSNotificationCenter defaultCenter] postNotificationName:@"RemoveGifFacePackageSuccess" object:nil userInfo:@{@"sectionId":_groupName}];
149 154 }
150   - [QMUITips hideAllTipsInView:AppKeyWindow];
  155 + [QMUITips hideAllTipsInView:[UIApplication sharedApplication].delegate.window];
151 156 // QMUITips *tips = [QMUITips showSucceed:@"移除成功" inView:AppKeyWindow hideAfterDelay:1];
152 157 // tips.backgroundColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.6];
153 158  
... ...
Example/CNLiveGifFace.xcodeproj/project.pbxproj
... ... @@ -207,7 +207,7 @@
207 207 6003F586195388D20070C39A /* Sources */,
208 208 6003F587195388D20070C39A /* Frameworks */,
209 209 6003F588195388D20070C39A /* Resources */,
210   - ECAC1BD9552FAE4C176008DA /* [CP] Embed Pods Frameworks */,
  210 + B29AB0376DAA7DACC0EC6B74 /* [CP] Embed Pods Frameworks */,
211 211 );
212 212 buildRules = (
213 213 );
... ... @@ -341,7 +341,7 @@
341 341 shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
342 342 showEnvVarsInLog = 0;
343 343 };
344   - ECAC1BD9552FAE4C176008DA /* [CP] Embed Pods Frameworks */ = {
  344 + B29AB0376DAA7DACC0EC6B74 /* [CP] Embed Pods Frameworks */ = {
345 345 isa = PBXShellScriptBuildPhase;
346 346 buildActionMask = 2147483647;
347 347 files = (
... ... @@ -349,18 +349,22 @@
349 349 inputFileListPaths = (
350 350 );
351 351 inputPaths = (
352   - "${SRCROOT}/Pods/Target Support Files/Pods-CNLiveGifFace_Example/Pods-CNLiveGifFace_Example-frameworks.sh",
  352 + "${PODS_ROOT}/Target Support Files/Pods-CNLiveGifFace_Example/Pods-CNLiveGifFace_Example-frameworks.sh",
353 353 "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
354 354 "${BUILT_PRODUCTS_DIR}/CNLiveBaseKit/CNLiveBaseKit.framework",
  355 + "${BUILT_PRODUCTS_DIR}/CNLiveCommonCategory/CNLiveCommonCategory.framework",
355 356 "${BUILT_PRODUCTS_DIR}/CNLiveCommonClass/CNLiveCommonClass.framework",
356 357 "${BUILT_PRODUCTS_DIR}/CNLiveCustomUI/CNLiveCustomUI.framework",
357 358 "${BUILT_PRODUCTS_DIR}/CNLiveGifFace/CNLiveGifFace.framework",
358 359 "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework",
359 360 "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework",
  361 + "${BUILT_PRODUCTS_DIR}/FLAnimatedImage/FLAnimatedImage.framework",
  362 + "${BUILT_PRODUCTS_DIR}/IMBaseSDK/IMBaseSDK.framework",
360 363 "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework",
361 364 "${BUILT_PRODUCTS_DIR}/MJRefresh/MJRefresh.framework",
362 365 "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework",
363 366 "${BUILT_PRODUCTS_DIR}/QMUIKit/QMUIKit.framework",
  367 + "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
364 368 "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
365 369 "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework",
366 370 "${BUILT_PRODUCTS_DIR}/WebViewJavascriptBridge/WebViewJavascriptBridge.framework",
... ... @@ -372,15 +376,19 @@
372 376 outputPaths = (
373 377 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
374 378 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveBaseKit.framework",
  379 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonCategory.framework",
375 380 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCommonClass.framework",
376 381 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveCustomUI.framework",
377 382 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveGifFace.framework",
378 383 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework",
379 384 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework",
  385 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FLAnimatedImage.framework",
  386 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IMBaseSDK.framework",
380 387 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework",
381 388 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJRefresh.framework",
382 389 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
383 390 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QMUIKit.framework",
  391 + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
384 392 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
385 393 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework",
386 394 "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebViewJavascriptBridge.framework",
... ... @@ -388,7 +396,7 @@
388 396 );
389 397 runOnlyForDeploymentPostprocessing = 0;
390 398 shellPath = /bin/sh;
391   - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CNLiveGifFace_Example/Pods-CNLiveGifFace_Example-frameworks.sh\"\n";
  399 + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveGifFace_Example/Pods-CNLiveGifFace_Example-frameworks.sh\"\n";
392 400 showEnvVarsInLog = 0;
393 401 };
394 402 /* End PBXShellScriptBuildPhase section */
... ... @@ -528,6 +536,7 @@
528 536 baseConfigurationReference = 2051FF30CDCC583E98B8C708 /* Pods-CNLiveGifFace_Example.debug.xcconfig */;
529 537 buildSettings = {
530 538 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  539 + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
531 540 DEVELOPMENT_TEAM = 94X49GG3ZW;
532 541 GCC_PRECOMPILE_PREFIX_HEADER = YES;
533 542 GCC_PREFIX_HEADER = "CNLiveGifFace/CNLiveGifFace-Prefix.pch";
... ... @@ -544,6 +553,7 @@
544 553 baseConfigurationReference = E069E0E0388F846BD9FDC4C8 /* Pods-CNLiveGifFace_Example.release.xcconfig */;
545 554 buildSettings = {
546 555 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
  556 + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
547 557 DEVELOPMENT_TEAM = 94X49GG3ZW;
548 558 GCC_PRECOMPILE_PREFIX_HEADER = YES;
549 559 GCC_PREFIX_HEADER = "CNLiveGifFace/CNLiveGifFace-Prefix.pch";
... ...
Example/Podfile
... ... @@ -13,3 +13,7 @@ target &#39;CNLiveGifFace_Example&#39; do
13 13  
14 14 end
15 15 end
  16 +pre_install do |installer|
  17 + # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
  18 + Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  19 +end
... ...