Commit 79ff889f3031b9be356ff6236a9cd33adfae5f3e
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/CNLiveBusinessTools
# Conflicts: # CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/QMUIEmotion+CNLiveEmotion.h # CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/QMUIEmotion+CNLiveEmotion.m
Showing
39 changed files
with
62 additions
and
2 deletions
.gitignore
100644 → 100755
.travis.yml
100644 → 100755
CNLiveBusinessTools.podspec
100644 → 100755
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | Pod::Spec.new do |s| |
| 10 | 10 | s.name = 'CNLiveBusinessTools' |
| 11 | - s.version = '0.1.22' | |
| 11 | + s.version = '0.1.23' | |
| 12 | 12 | s.summary = '业务工具集合组件.' |
| 13 | 13 | |
| 14 | 14 | # This description is used to generate tags and improve search results. |
| ... | ... | @@ -28,7 +28,7 @@ Pod::Spec.new do |s| |
| 28 | 28 | s.source = { :git => 'http://bj.gitlab.cnlive.com/ios-team/CNLiveBusinessTools.git', :tag => s.version.to_s } |
| 29 | 29 | # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' |
| 30 | 30 | |
| 31 | - s.ios.deployment_target = '9.0' | |
| 31 | + s.ios.deployment_target = '10.0' | |
| 32 | 32 | |
| 33 | 33 | s.source_files = 'CNLiveBusinessTools/Classes/**/*' |
| 34 | 34 | ... | ... |
CNLiveBusinessTools/Assets/.gitkeep
100644 → 100755
CNLiveBusinessTools/Assets/CNLive_QQEmotion.bundle/Contents/Resources/smiley_78.png
100644 → 100755
CNLiveBusinessTools/Classes/.gitkeep
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveBusinessTools.h
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveBusinessTools.m
100644 → 100755
| ... | ... | @@ -1074,6 +1074,24 @@ |
| 1074 | 1074 | [attStr replaceCharactersInRange:result.range withAttributedString:imageStr]; |
| 1075 | 1075 | NSLog(@"\n11111:text%@,range:%@",text,NSStringFromRange(result.range)); |
| 1076 | 1076 | } |
| 1077 | + else if([[text substringWithRange:result.range] cn_containsString:emojiArr[j].identifier]) | |
| 1078 | + { | |
| 1079 | + NSString *resultStr = [text substringWithRange:result.range]; | |
| 1080 | + resultStr = [resultStr stringByReplacingOccurrencesOfString:@"[" withString:@""]; | |
| 1081 | + resultStr = [resultStr stringByReplacingOccurrencesOfString:@"]" withString:@""]; | |
| 1082 | + if ([resultStr isEqualToString:emojiArr[j].identifier]) { | |
| 1083 | + | |
| 1084 | + CNEmojiTextAttachment *textAttachment = [[CNEmojiTextAttachment alloc]init]; | |
| 1085 | + textAttachment.image = emojiArr[j].image; | |
| 1086 | + textAttachment.bounds = CGRectMake(0, -4.7, 20*RATIO, 20*RATIO); | |
| 1087 | + textAttachment.emojiText = emojiArr[j].displayName; | |
| 1088 | + | |
| 1089 | + NSAttributedString *imageStr = [NSAttributedString attributedStringWithAttachment:textAttachment]; | |
| 1090 | + [attStr replaceCharactersInRange:result.range withAttributedString:imageStr]; | |
| 1091 | + NSLog(@"\n11111:text%@,range:%@",text,NSStringFromRange(result.range)); | |
| 1092 | + } | |
| 1093 | + | |
| 1094 | + } | |
| 1077 | 1095 | } |
| 1078 | 1096 | }else |
| 1079 | 1097 | {//目前只有 暂时没有判断是否是url办法 表情和url | ... | ... |
CNLiveBusinessTools/Classes/CNLiveBusinessToolsHeader.h
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNEmojiTextAttachment.h
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNEmojiTextAttachment.m
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNLiveEmotionHelper.h
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNLiveEmotionHelper.m
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNLiveQQEmotionManager.h
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/CNLiveQQEmotionManager.m
100644 → 100755
CNLiveBusinessTools/Classes/CNLiveQQEmotionManager/QMUIEmotion+CNLiveEmotion.h
0 → 100755
| 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
0 → 100755
| 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 | ... | ... |
CNLiveBusinessTools/Classes/HttpService.h
100644 → 100755
CNLiveBusinessTools/Classes/HttpService.m
100644 → 100755
Example/CNLiveBusinessTools.xcodeproj/project.pbxproj
100644 → 100755
Example/CNLiveBusinessTools.xcodeproj/xcshareddata/xcschemes/CNLiveBusinessTools-Example.xcscheme
100644 → 100755
Example/CNLiveBusinessTools/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Example/CNLiveBusinessTools/Base.lproj/Main.storyboard
100644 → 100755
Example/CNLiveBusinessTools/CNLiveAppDelegate.h
100644 → 100755
Example/CNLiveBusinessTools/CNLiveAppDelegate.m
100644 → 100755
Example/CNLiveBusinessTools/CNLiveBusinessTools-Info.plist
100644 → 100755
Example/CNLiveBusinessTools/CNLiveBusinessTools-Prefix.pch
100644 → 100755
Example/CNLiveBusinessTools/CNLiveViewController.h
100644 → 100755
Example/CNLiveBusinessTools/CNLiveViewController.m
100644 → 100755
Example/CNLiveBusinessTools/Images.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Example/CNLiveBusinessTools/en.lproj/InfoPlist.strings
100644 → 100755
Example/CNLiveBusinessTools/main.m
100644 → 100755
Example/Podfile
100644 → 100755
Example/Tests/Tests-Info.plist
100644 → 100755
Example/Tests/Tests-Prefix.pch
100644 → 100755
Example/Tests/Tests.m
100644 → 100755
Example/Tests/en.lproj/InfoPlist.strings
100644 → 100755
LICENSE
100644 → 100755
README.md
100644 → 100755