Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3bf2ade

Browse files
author
mengyaoyao
committed
键盘录音部分UI更新
1 parent c66c207 commit 3bf2ade

File tree

15 files changed

+2224
-94
lines changed

15 files changed

+2224
-94
lines changed

‎CocoaAsyncSocket_TCP.xcodeproj/project.pbxproj

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
B8565C921ECC67D300D53996 /* ChatRecordCover.m in Sources */ = {isa = PBXBuildFile; fileRef = B8565C911ECC67D300D53996 /* ChatRecordCover.m */; };
1110
B85F39BF1EC9C95100B2EA9E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B85F39BE1EC9C95100B2EA9E /* main.m */; };
1211
B85F39C81EC9C95100B2EA9E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B85F39C61EC9C95100B2EA9E /* Main.storyboard */; };
1312
B85F39CA1EC9C95100B2EA9E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B85F39C91EC9C95100B2EA9E /* Assets.xcassets */; };
@@ -60,6 +59,11 @@
6059
B85F3A8C1EC9C9E400B2EA9E /* ChatHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = B85F3A861EC9C9E400B2EA9E /* ChatHandler.m */; };
6160
B85F3A8D1EC9C9E400B2EA9E /* ChatUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B85F3A881EC9C9E400B2EA9E /* ChatUtil.m */; };
6261
B85F3A8E1EC9C9E400B2EA9E /* ChatModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B85F3A8B1EC9C9E400B2EA9E /* ChatModel.m */; };
62+
B8661AA21ECD7D120022753D /* libmp3lame.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B8661A9E1ECD7D120022753D /* libmp3lame.a */; };
63+
B8661AA31ECD7D120022753D /* Mp3Recorder.m in Sources */ = {isa = PBXBuildFile; fileRef = B8661AA01ECD7D120022753D /* Mp3Recorder.m */; };
64+
B8661AA41ECD7D120022753D /* TSMessagesDefaultDesign.json in Resources */ = {isa = PBXBuildFile; fileRef = B8661AA11ECD7D120022753D /* TSMessagesDefaultDesign.json */; };
65+
B8661AA71ECD95680022753D /* ChatRecordTool.m in Sources */ = {isa = PBXBuildFile; fileRef = B8661AA61ECD95680022753D /* ChatRecordTool.m */; };
66+
B8661AAA1ECD998E0022753D /* UIImageView+GIF.m in Sources */ = {isa = PBXBuildFile; fileRef = B8661AA91ECD998E0022753D /* UIImageView+GIF.m */; };
6367
E1527204E4A6C66E20ABAB19 /* Pods_CocoaAsyncSocket_TCP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24AA3076491D2596209CE424 /* Pods_CocoaAsyncSocket_TCP.framework */; };
6468
/* End PBXBuildFile section */
6569

@@ -84,8 +88,6 @@
8488
24AA3076491D2596209CE424 /* Pods_CocoaAsyncSocket_TCP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaAsyncSocket_TCP.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8589
4AE7FCF3D1D9A8F040607338 /* Pods-CocoaAsyncSocket_TCP.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocket_TCP.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocket_TCP/Pods-CocoaAsyncSocket_TCP.release.xcconfig"; sourceTree = "<group>"; };
8690
66DD7434C83D6F468099D4BF /* Pods-CocoaAsyncSocket_TCP.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaAsyncSocket_TCP.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaAsyncSocket_TCP/Pods-CocoaAsyncSocket_TCP.debug.xcconfig"; sourceTree = "<group>"; };
87-
B8565C901ECC67D300D53996 /* ChatRecordCover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatRecordCover.h; sourceTree = "<group>"; };
88-
B8565C911ECC67D300D53996 /* ChatRecordCover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatRecordCover.m; sourceTree = "<group>"; };
8991
B85F39BA1EC9C95100B2EA9E /* CocoaAsyncSocket_TCP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CocoaAsyncSocket_TCP.app; sourceTree = BUILT_PRODUCTS_DIR; };
9092
B85F39BE1EC9C95100B2EA9E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
9193
B85F39C71EC9C95100B2EA9E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@@ -191,6 +193,16 @@
191193
B85F3A881EC9C9E400B2EA9E /* ChatUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatUtil.m; sourceTree = "<group>"; };
192194
B85F3A8A1EC9C9E400B2EA9E /* ChatModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatModel.h; sourceTree = "<group>"; };
193195
B85F3A8B1EC9C9E400B2EA9E /* ChatModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatModel.m; sourceTree = "<group>"; };
196+
B8661A9C1ECD7D120022753D /* ACMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACMacros.h; sourceTree = "<group>"; };
197+
B8661A9D1ECD7D120022753D /* lame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lame.h; sourceTree = "<group>"; };
198+
B8661A9E1ECD7D120022753D /* libmp3lame.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libmp3lame.a; sourceTree = "<group>"; };
199+
B8661A9F1ECD7D120022753D /* Mp3Recorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mp3Recorder.h; sourceTree = "<group>"; };
200+
B8661AA01ECD7D120022753D /* Mp3Recorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Mp3Recorder.m; sourceTree = "<group>"; };
201+
B8661AA11ECD7D120022753D /* TSMessagesDefaultDesign.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = TSMessagesDefaultDesign.json; sourceTree = "<group>"; };
202+
B8661AA51ECD95680022753D /* ChatRecordTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatRecordTool.h; sourceTree = "<group>"; };
203+
B8661AA61ECD95680022753D /* ChatRecordTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatRecordTool.m; sourceTree = "<group>"; };
204+
B8661AA81ECD998E0022753D /* UIImageView+GIF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+GIF.h"; sourceTree = "<group>"; };
205+
B8661AA91ECD998E0022753D /* UIImageView+GIF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+GIF.m"; sourceTree = "<group>"; };
194206
/* End PBXFileReference section */
195207

196208
/* Begin PBXFrameworksBuildPhase section */
@@ -199,6 +211,7 @@
199211
buildActionMask = 2147483647;
200212
files = (
201213
E1527204E4A6C66E20ABAB19 /* Pods_CocoaAsyncSocket_TCP.framework in Frameworks */,
214+
B8661AA21ECD7D120022753D /* libmp3lame.a in Frameworks */,
202215
);
203216
runOnlyForDeploymentPostprocessing = 0;
204217
};
@@ -222,8 +235,9 @@
222235
B8565C8F1ECC67C300D53996 /* ChatRecordCover */ = {
223236
isa = PBXGroup;
224237
children = (
225-
B8565C901ECC67D300D53996 /* ChatRecordCover.h */,
226-
B8565C911ECC67D300D53996 /* ChatRecordCover.m */,
238+
B8661A9B1ECD7D120022753D /* RecordUtil */,
239+
B8661AA51ECD95680022753D /* ChatRecordTool.h */,
240+
B8661AA61ECD95680022753D /* ChatRecordTool.m */,
227241
);
228242
path = ChatRecordCover;
229243
sourceTree = "<group>";
@@ -353,6 +367,8 @@
353367
B85F3A061EC9C9C600B2EA9E /* UIImage+colorImage.m */,
354368
B85F3A071EC9C9C600B2EA9E /* UIImageView+SDWebImage.h */,
355369
B85F3A081EC9C9C600B2EA9E /* UIImageView+SDWebImage.m */,
370+
B8661AA81ECD998E0022753D /* UIImageView+GIF.h */,
371+
B8661AA91ECD998E0022753D /* UIImageView+GIF.m */,
356372
);
357373
path = Category;
358374
sourceTree = "<group>";
@@ -542,6 +558,19 @@
542558
path = ChatModel;
543559
sourceTree = "<group>";
544560
};
561+
B8661A9B1ECD7D120022753D /* RecordUtil */ = {
562+
isa = PBXGroup;
563+
children = (
564+
B8661A9C1ECD7D120022753D /* ACMacros.h */,
565+
B8661A9D1ECD7D120022753D /* lame.h */,
566+
B8661A9E1ECD7D120022753D /* libmp3lame.a */,
567+
B8661A9F1ECD7D120022753D /* Mp3Recorder.h */,
568+
B8661AA01ECD7D120022753D /* Mp3Recorder.m */,
569+
B8661AA11ECD7D120022753D /* TSMessagesDefaultDesign.json */,
570+
);
571+
path = RecordUtil;
572+
sourceTree = "<group>";
573+
};
545574
CBB7B1986CB029097EB5B82F /* Frameworks */ = {
546575
isa = PBXGroup;
547576
children = (
@@ -672,6 +701,7 @@
672701
B85F39CA1EC9C95100B2EA9E /* Assets.xcassets in Resources */,
673702
B85F3A821EC9C9DE00B2EA9E /* ChatListCell.xib in Resources */,
674703
B85F3A601EC9C9C600B2EA9E /* Tabbars.plist in Resources */,
704+
B8661AA41ECD7D120022753D /* TSMessagesDefaultDesign.json in Resources */,
675705
B85F39C81EC9C95100B2EA9E /* Main.storyboard in Resources */,
676706
);
677707
runOnlyForDeploymentPostprocessing = 0;
@@ -757,8 +787,8 @@
757787
B85F3A631EC9C9C600B2EA9E /* LastViewController.m in Sources */,
758788
B85F3A831EC9C9DE00B2EA9E /* ChatKeyboard.m in Sources */,
759789
B85F3A651EC9C9C600B2EA9E /* ThirdViewController.m in Sources */,
760-
B8565C921ECC67D300D53996 /* ChatRecordCover.m in Sources */,
761790
B85F3A4C1EC9C9C600B2EA9E /* UIImageView+SDWebImage.m in Sources */,
791+
B8661AA31ECD7D120022753D /* Mp3Recorder.m in Sources */,
762792
B85F3A641EC9C9C600B2EA9E /* MainViewController.m in Sources */,
763793
B85F3A8E1EC9C9E400B2EA9E /* ChatModel.m in Sources */,
764794
B85F3A581EC9C9C600B2EA9E /* ReachStateWIFI.m in Sources */,
@@ -768,7 +798,9 @@
768798
B85F3A611EC9C9C600B2EA9E /* ChatListViewController.m in Sources */,
769799
B85F3A7E1EC9C9DE00B2EA9E /* ChatTextCell.m in Sources */,
770800
B85F3A571EC9C9C600B2EA9E /* ReachStateUnReachable.m in Sources */,
801+
B8661AA71ECD95680022753D /* ChatRecordTool.m in Sources */,
771802
B85F3A551EC9C9C600B2EA9E /* ReachStateLoading.m in Sources */,
803+
B8661AAA1ECD998E0022753D /* UIImageView+GIF.m in Sources */,
772804
B85F3A491EC9C9C600B2EA9E /* NSDate+extension.m in Sources */,
773805
B85F3A621EC9C9C600B2EA9E /* ChatViewController.m in Sources */,
774806
B85F3A4E1EC9C9C600B2EA9E /* MYCoretextResultTool.m in Sources */,
@@ -943,6 +975,10 @@
943975
GCC_PREFIX_HEADER = CocoaAsyncSocket_TCP/Comon/PrefixHeader.pch;
944976
INFOPLIST_FILE = CocoaAsyncSocket_TCP/Info.plist;
945977
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
978+
LIBRARY_SEARCH_PATHS = (
979+
"$(inherited)",
980+
"$(PROJECT_DIR)/CocoaAsyncSocket_TCP/View/ChatRecordCover/RecordUtil",
981+
);
946982
PRODUCT_BUNDLE_IDENTIFIER = "com.mengyao-block-outlook.CocoaAsyncSocket-TCP";
947983
PRODUCT_NAME = "$(TARGET_NAME)";
948984
};
@@ -956,6 +992,10 @@
956992
GCC_PREFIX_HEADER = CocoaAsyncSocket_TCP/Comon/PrefixHeader.pch;
957993
INFOPLIST_FILE = CocoaAsyncSocket_TCP/Info.plist;
958994
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
995+
LIBRARY_SEARCH_PATHS = (
996+
"$(inherited)",
997+
"$(PROJECT_DIR)/CocoaAsyncSocket_TCP/View/ChatRecordCover/RecordUtil",
998+
);
959999
PRODUCT_BUNDLE_IDENTIFIER = "com.mengyao-block-outlook.CocoaAsyncSocket-TCP";
9601000
PRODUCT_NAME = "$(TARGET_NAME)";
9611001
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// UIImageView+GIF.h
3+
// CocoaAsyncSocket_TCP
4+
//
5+
// Created by 孟遥 on 2017年5月18日.
6+
// Copyright © 2017年 mengyao. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface UIImageView (GIF)
12+
//播放GIF
13+
- (void)GIF_PrePlayWithImageNamesArray:(NSArray *)array duration:(NSInteger)duration;
14+
//停止播放
15+
- (void)GIF_Stop;
16+
17+
@end
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// UIImageView+GIF.m
3+
// CocoaAsyncSocket_TCP
4+
//
5+
// Created by 孟遥 on 2017年5月18日.
6+
// Copyright © 2017年 mengyao. All rights reserved.
7+
//
8+
9+
#import "UIImageView+GIF.h"
10+
11+
@implementation UIImageView (GIF)
12+
13+
//准备GIF播放
14+
- (void)GIF_PrePlayWithImageNamesArray:(NSArray *)array duration:(NSInteger)duration
15+
{
16+
self.hidden = NO;
17+
NSMutableArray *arr = [NSMutableArray array];
18+
[array enumerateObjectsUsingBlock:^(NSString *_Nonnull imageName, NSUInteger idx, BOOL * _Nonnull stop) {
19+
20+
UIImage *image = [UIImage imageNamed:imageName];
21+
[arr addObject:image];
22+
}];
23+
//设置序列帧图像数组
24+
self.animationImages = arr;
25+
//设置动画时间
26+
self.animationDuration = 1;
27+
//设置播放次数,0代表无限次
28+
self.animationRepeatCount = (NSInteger)duration;
29+
[self startAnimating];
30+
//赋值
31+
// objc_setAssociatedObject(self ,&imageViewKey ,imageView ,OBJC_ASSOCIATION_RETAIN_NONATOMIC);
32+
}
33+
34+
//停止播放
35+
- (void)GIF_Stop
36+
{
37+
[self stopAnimating];
38+
}
39+
40+
@end

‎CocoaAsyncSocket_TCP/Comon/PrefixHeader.pch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
#import "UIImageView+SDWebImage.h"
1818
#import "NSDate+extension.h"
1919
#import "NSString+extension.h"
20+
#import "UIImageView+GIF.h"
2021

2122
#endif /* PrefixHeader_pch */

‎CocoaAsyncSocket_TCP/View/ChatRecordCover/ChatRecordCover.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎CocoaAsyncSocket_TCP/View/ChatRecordCover/ChatRecordCover.m

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// ChatRecordTool.h
3+
// CocoaAsyncSocket_TCP
4+
//
5+
// Created by 孟遥 on 2017年5月18日.
6+
// Copyright © 2017年 mengyao. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface ChatRecordTool : NSObject
12+
13+
//初始化录音蒙板
14+
+ (instancetype)chatRecordTool;
15+
//开始录音
16+
- (void)beginRecord;
17+
//取消录音
18+
- (void)cancelRecord;
19+
//录音结束
20+
- (void)stopRecord;
21+
//手指移开录音按钮
22+
- (void)moveOut;
23+
//继续录制
24+
- (void)continueRecord;
25+
26+
@end

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /