Commit ae82a742fffce96d425b6ca8888c2a7b51f748a5
1 parent
72ccd29d
解决依赖问题
Showing
8 changed files
with
48 additions
and
61 deletions
CNLiveBusinessTools/Classes/CNLiveBusinessTools.h
| ... | ... | @@ -6,7 +6,13 @@ |
| 6 | 6 | // |
| 7 | 7 | |
| 8 | 8 | #import <Foundation/Foundation.h> |
| 9 | - | |
| 9 | +#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 10 | +#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 11 | +#import "CommonCrypto/CommonDigest.h" | |
| 12 | +#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 13 | +#import "CNEmojiTextAttachment.h" | |
| 14 | +#import <QMUIKit/QMUIEmotionView.h> | |
| 15 | +#import "CNLiveQQEmotionManager.h" | |
| 10 | 16 | NS_ASSUME_NONNULL_BEGIN |
| 11 | 17 | typedef NS_ENUM(NSInteger, CNStatType) { |
| 12 | 18 | CNStatTypeContentCount = 0, //内容次数统计 | ... | ... |
CNLiveBusinessTools/Classes/CNLiveBusinessTools.m
| ... | ... | @@ -7,13 +7,6 @@ |
| 7 | 7 | |
| 8 | 8 | #import "CNLiveBusinessTools.h" |
| 9 | 9 | #import <Photos/Photos.h> |
| 10 | -#import <CNLiveEnvironment/CNLiveEnvironment.h> | |
| 11 | -#import <CNLiveUserManagement/CNUserInfoManager.h> | |
| 12 | -#import "CommonCrypto/CommonDigest.h" | |
| 13 | -#import <CNLiveBaseKit/CNLiveBaseKit.h> | |
| 14 | -#import "CNEmojiTextAttachment.h" | |
| 15 | -#import <QMUIKit/QMUIEmotionView.h> | |
| 16 | -#import "CNLiveQQEmotionManager.h" | |
| 17 | 10 | #import <YYKit/YYKit.h> |
| 18 | 11 | @implementation CNLiveBusinessTools |
| 19 | 12 | ... | ... |
CNLiveBusinessTools/Classes/CNLiveBusinessToolsHeader.h
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNLiveQQEmotionManager.m
| ... | ... | @@ -7,8 +7,8 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLiveQQEmotionManager.h" |
| 10 | -#import "QMUIEmotion+CNLiveEmotion.h" | |
| 11 | 10 | #import "CNLiveEmotionHelper.h" |
| 11 | + | |
| 12 | 12 | /** |
| 13 | 13 | * 加载Emoji图片资源失败标识 |
| 14 | 14 | */ |
| ... | ... | @@ -139,7 +139,7 @@ static NSArray<QMUIEmotion *> *QQEmotionArray; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | + (UIImage *)imageForQQEmotionWithIdentifier:(NSString *)identifier { |
| 142 | - return [CNLiveEmotionHelper emotionImageInBundle:[CNLiveEmotionHelper emotionResourcesBundleWithName:CNLiveResourcesQQEmotionBundleName] withName:identifier]; | |
| 142 | + return [CNLiveEmotionHelper emotionImageInBundle:[CNLiveEmotionHelper emotionResourcesBundleWithName:@"CNLive_QQEmotion.bundle"] withName:identifier]; | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | + (NSArray<QMUIEmotion *> *)emotionsForQQ { |
| ... | ... | @@ -178,7 +178,7 @@ static NSArray<QMUIEmotion *> *QQEmotionArray; |
| 178 | 178 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
| 179 | 179 | for (QMUIEmotion *e in emotions) { |
| 180 | 180 | if (e.image == nil) { |
| 181 | - UIImage *image = [QMUIEmotion cnliveImageWithEmotion:e]; | |
| 181 | + UIImage *image = [CNLiveEmotionHelper emotionImageInBundle:[CNLiveEmotionHelper emotionResourcesBundleWithName:@"CNLive_QQEmotion.bundle"] withName:e.identifier];//[QMUIEmotion cnliveImageWithEmotion:e]; | |
| 182 | 182 | if (image == nil) { |
| 183 | 183 | NSLog(@"加载emoji失败id:%@",e.identifier); |
| 184 | 184 | isLoadEmojiFailed = YES; | ... | ... |
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/QMUIEmotion+CNLiveEmotion.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// QMUIEmotion+CNLiveEmotion.h | |
| 3 | -// CNLiveNetAdd | |
| 4 | -// | |
| 5 | -// Created by 张旭 on 2018/11/3. | |
| 6 | -// Copyright © 2018 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <QMUIKit/QMUIKit.h> | |
| 10 | - | |
| 11 | -NS_ASSUME_NONNULL_BEGIN | |
| 12 | - | |
| 13 | -#define CNLiveResourcesQQEmotionBundleName @"CNLive_QQEmotion.bundle" | |
| 14 | - | |
| 15 | -@interface QMUIEmotion (CNLiveEmotion) | |
| 16 | - | |
| 17 | -+ (UIImage *)cnliveImageWithEmotion:(QMUIEmotion *)emotion; | |
| 18 | - | |
| 19 | -@end | |
| 20 | - | |
| 21 | -NS_ASSUME_NONNULL_END |
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/QMUIEmotion+CNLiveEmotion.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// QMUIEmotion+CNLiveEmotion.m | |
| 3 | -// CNLiveNetAdd | |
| 4 | -// | |
| 5 | -// Created by 张旭 on 2018/11/3. | |
| 6 | -// Copyright © 2018 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "QMUIEmotion+CNLiveEmotion.h" | |
| 10 | -#import "CNLiveEmotionHelper.h" | |
| 11 | -@implementation QMUIEmotion (CNLiveEmotion) | |
| 12 | - | |
| 13 | -+ (UIImage *)cnliveImageWithEmotion:(QMUIEmotion *)emotion | |
| 14 | -{ | |
| 15 | - UIImage *image = [CNLiveEmotionHelper emotionImageInBundle:[CNLiveEmotionHelper emotionResourcesBundleWithName:CNLiveResourcesQQEmotionBundleName] withName:emotion.identifier]; | |
| 16 | - return image; | |
| 17 | -} | |
| 18 | - | |
| 19 | - | |
| 20 | - | |
| 21 | -@end |
Example/CNLiveBusinessTools/CNLiveViewController.m
| ... | ... | @@ -7,9 +7,14 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "CNLiveViewController.h" |
| 10 | +#import <QMUIKit/QMUIKit.h> | |
| 11 | +//#import <CNLiveBusinessTools/CNLiveQQEmotionManager.h> | |
| 10 | 12 | |
| 11 | -@interface CNLiveViewController () | |
| 13 | +#define KScreenWidth ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.height : [UIScreen mainScreen].bounds.size.width) | |
| 14 | +#define KScreenHeight ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.width : [UIScreen mainScreen].bounds.size.height) | |
| 12 | 15 | |
| 16 | +@interface CNLiveViewController () | |
| 17 | +//@property (nonatomic, strong) CNLiveQQEmotionManager *emotionInputManager; | |
| 13 | 18 | @end |
| 14 | 19 | |
| 15 | 20 | @implementation CNLiveViewController |
| ... | ... | @@ -18,6 +23,7 @@ |
| 18 | 23 | { |
| 19 | 24 | [super viewDidLoad]; |
| 20 | 25 | // Do any additional setup after loading the view, typically from a nib. |
| 26 | +// [self.view addSubview:self.emotionInputManager.emotionView]; | |
| 21 | 27 | } |
| 22 | 28 | |
| 23 | 29 | - (void)didReceiveMemoryWarning |
| ... | ... | @@ -26,4 +32,29 @@ |
| 26 | 32 | // Dispose of any resources that can be recreated. |
| 27 | 33 | } |
| 28 | 34 | |
| 35 | +//-(CNLiveQQEmotionManager *)emotionInputManager | |
| 36 | +//{ | |
| 37 | +// if (!_emotionInputManager) { | |
| 38 | +// _emotionInputManager = [[CNLiveQQEmotionManager alloc] init]; | |
| 39 | +// _emotionInputManager.emotionView.frame = CGRectMake(0, 200, KScreenWidth, 232); | |
| 40 | +//// _emotionInputManager.boundTextView = self.toolbarTextView; | |
| 41 | +// _emotionInputManager.emotionView.qmui_borderPosition = QMUIToastViewPositionTop; | |
| 42 | +// _emotionInputManager.emotionView.sendButton.hidden = YES; | |
| 43 | +// _emotionInputManager.emotionView.numberOfRowsPerPage = 3;//{18, 18, 65, 18} | |
| 44 | +// _emotionInputManager.emotionView.paddingInPage = UIEdgeInsetsMake(18, 18, 50, 18); | |
| 45 | +// _emotionInputManager.emotionView.pageControlMarginBottom = 0; | |
| 46 | +// _emotionInputManager.emotionView.minimumEmotionHorizontalSpacing = 15; | |
| 47 | +// _emotionInputManager.emotionView.didSelectEmotionBlock = ^(NSInteger index, QMUIEmotion *emotion) { | |
| 48 | +//// [weakSelf onInputSystemFace:index emotion:emotion]; | |
| 49 | +// }; | |
| 50 | +// _emotionInputManager.emotionView.didSelectDeleteButtonBlock = ^{ | |
| 51 | +//// if ([weakSelf.toolbarTextView.text isEqualToString:@""]) | |
| 52 | +// return; | |
| 53 | +// | |
| 54 | +//// [weakSelf deleteEmotionDisplayNameAtCurrentTextView:weakSelf.toolbarTextView]; | |
| 55 | +// }; | |
| 56 | +// } | |
| 57 | +// return _emotionInputManager; | |
| 58 | +//} | |
| 59 | + | |
| 29 | 60 | @end | ... | ... |
Example/Podfile
| ... | ... | @@ -9,12 +9,12 @@ platform :ios, '9.0' |
| 9 | 9 | target 'CNLiveBusinessTools_Example' do |
| 10 | 10 | pod 'CNLiveBusinessTools', :path => '../' |
| 11 | 11 | |
| 12 | - pod 'CNLiveEnvironment' | |
| 13 | - pod 'CNLiveUserManagement' | |
| 14 | - pod 'CNLiveBaseKit' | |
| 15 | - pod 'CNLiveRequestBastKit' | |
| 16 | - pod 'CNLiveTripartiteManagement/QMUIKit' | |
| 17 | - pod 'CNLiveTripartiteManagement/YYKit' | |
| 12 | +# pod 'CNLiveEnvironment' | |
| 13 | +# pod 'CNLiveUserManagement' | |
| 14 | +# pod 'CNLiveBaseKit' | |
| 15 | +# pod 'CNLiveRequestBastKit' | |
| 16 | +# pod 'CNLiveTripartiteManagement/QMUIKit' | |
| 17 | +# pod 'CNLiveTripartiteManagement/YYKit' | |
| 18 | 18 | |
| 19 | 19 | target 'CNLiveBusinessTools_Tests' do |
| 20 | 20 | inherit! :search_paths | ... | ... |