Skip to content

Commit fede5a9

Browse files
author
Hilen
committed
Remove warning, replace some method
1 parent 2979d74 commit fede5a9

19 files changed

+57
-223
lines changed

TSWeChat.xcodeproj/project.pbxproj

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@
5252
AE8F49AD1C46A905009C1541 /* CGRect+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F499E1C46A905009C1541 /* CGRect+Extension.swift */; };
5353
AE8F49AE1C46A905009C1541 /* Device.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F499F1C46A905009C1541 /* Device.swift */; };
5454
AE8F49B01C46A905009C1541 /* NSDictionary+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A11C46A905009C1541 /* NSDictionary+Extension.swift */; };
55-
AE8F49B11C46A905009C1541 /* NSNotificationCenter+Block.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A21C46A905009C1541 /* NSNotificationCenter+Block.swift */; };
5655
AE8F49B21C46A905009C1541 /* NSObject+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A31C46A905009C1541 /* NSObject+String.swift */; };
5756
AE8F49B31C46A905009C1541 /* UIBarButtonItem+Block.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A41C46A905009C1541 /* UIBarButtonItem+Block.swift */; };
5857
AE8F49B51C46A905009C1541 /* UIScreen+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A61C46A905009C1541 /* UIScreen+Extension.swift */; };
5958
AE8F49B61C46A905009C1541 /* UISearchBar+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A71C46A905009C1541 /* UISearchBar+Extension.swift */; };
60-
AE8F49B81C46A905009C1541 /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49A91C46A905009C1541 /* UIView+Extension.swift */; };
6159
AE8F49B91C46A905009C1541 /* UIView+Frame.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49AA1C46A905009C1541 /* UIView+Frame.swift */; };
6260
AE8F49BA1C46A905009C1541 /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49AB1C46A905009C1541 /* UIViewController+Extension.swift */; };
6361
AE8F49C01C46AA5F009C1541 /* Notes.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8F49BF1C46AA5F009C1541 /* Notes.swift */; };
@@ -92,7 +90,6 @@
9290
AEE69A5A1C7CB07C00C69224 /* Expression.plist in Resources */ = {isa = PBXBuildFile; fileRef = AEE69A591C7CB07C00C69224 /* Expression.plist */; };
9391
AEE69B251C7CB2AF00C69224 /* Expression.bundle in Resources */ = {isa = PBXBuildFile; fileRef = AEE69B241C7CB2AF00C69224 /* Expression.bundle */; };
9492
AEE69B621C81997500C69224 /* PHAsset+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE69B5F1C81997500C69224 /* PHAsset+Extension.swift */; };
95-
AEE69B641C81997500C69224 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE69B611C81997500C69224 /* String+Extension.swift */; };
9693
AEE69B661C81999E00C69224 /* UIImage+Orientation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE69B651C81999E00C69224 /* UIImage+Orientation.swift */; };
9794
AEE69BA01C81B58600C69224 /* TSChatBaseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE69B691C81B58600C69224 /* TSChatBaseCell.swift */; };
9895
AEE69BA11C81B58600C69224 /* TSChatCellDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE69B6A1C81B58600C69224 /* TSChatCellDelegate.swift */; };
@@ -203,12 +200,10 @@
203200
AE8F499E1C46A905009C1541 /* CGRect+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CGRect+Extension.swift"; sourceTree = "<group>"; };
204201
AE8F499F1C46A905009C1541 /* Device.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Device.swift; sourceTree = "<group>"; };
205202
AE8F49A11C46A905009C1541 /* NSDictionary+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDictionary+Extension.swift"; sourceTree = "<group>"; };
206-
AE8F49A21C46A905009C1541 /* NSNotificationCenter+Block.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSNotificationCenter+Block.swift"; sourceTree = "<group>"; };
207203
AE8F49A31C46A905009C1541 /* NSObject+String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSObject+String.swift"; sourceTree = "<group>"; };
208204
AE8F49A41C46A905009C1541 /* UIBarButtonItem+Block.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIBarButtonItem+Block.swift"; sourceTree = "<group>"; };
209205
AE8F49A61C46A905009C1541 /* UIScreen+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIScreen+Extension.swift"; sourceTree = "<group>"; };
210206
AE8F49A71C46A905009C1541 /* UISearchBar+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UISearchBar+Extension.swift"; sourceTree = "<group>"; };
211-
AE8F49A91C46A905009C1541 /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
212207
AE8F49AA1C46A905009C1541 /* UIView+Frame.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Frame.swift"; sourceTree = "<group>"; };
213208
AE8F49AB1C46A905009C1541 /* UIViewController+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = "<group>"; };
214209
AE8F49BE1C46A95E009C1541 /* TSWeChat-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TSWeChat-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -248,7 +243,6 @@
248243
AEE69A591C7CB07C00C69224 /* Expression.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expression.plist; sourceTree = "<group>"; };
249244
AEE69B241C7CB2AF00C69224 /* Expression.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Expression.bundle; sourceTree = "<group>"; };
250245
AEE69B5F1C81997500C69224 /* PHAsset+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PHAsset+Extension.swift"; sourceTree = "<group>"; };
251-
AEE69B611C81997500C69224 /* String+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
252246
AEE69B651C81999E00C69224 /* UIImage+Orientation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Orientation.swift"; sourceTree = "<group>"; };
253247
AEE69B691C81B58600C69224 /* TSChatBaseCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TSChatBaseCell.swift; sourceTree = "<group>"; };
254248
AEE69B6A1C81B58600C69224 /* TSChatCellDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TSChatCellDelegate.swift; sourceTree = "<group>"; };
@@ -403,15 +397,12 @@
403397
AE8F499F1C46A905009C1541 /* Device.swift */,
404398
AE8742781C7AE48A003A435C /* NSDate+Extension.swift */,
405399
AE8F49A11C46A905009C1541 /* NSDictionary+Extension.swift */,
406-
AE8F49A21C46A905009C1541 /* NSNotificationCenter+Block.swift */,
407400
AE8F49A31C46A905009C1541 /* NSObject+String.swift */,
408401
AEE69B5F1C81997500C69224 /* PHAsset+Extension.swift */,
409-
AEE69B611C81997500C69224 /* String+Extension.swift */,
410402
AE8F49A41C46A905009C1541 /* UIBarButtonItem+Block.swift */,
411403
AEE69B651C81999E00C69224 /* UIImage+Orientation.swift */,
412404
AE8F49A61C46A905009C1541 /* UIScreen+Extension.swift */,
413405
AE8F49A71C46A905009C1541 /* UISearchBar+Extension.swift */,
414-
AE8F49A91C46A905009C1541 /* UIView+Extension.swift */,
415406
AE8F49AA1C46A905009C1541 /* UIView+Frame.swift */,
416407
AE8F49AB1C46A905009C1541 /* UIViewController+Extension.swift */,
417408
);
@@ -756,7 +747,7 @@
756747
attributes = {
757748
CLASSPREFIX = TS;
758749
LastSwiftUpdateCheck = 0720;
759-
LastUpgradeCheck = 0720;
750+
LastUpgradeCheck = 0810;
760751
ORGANIZATIONNAME = Hilen;
761752
TargetAttributes = {
762753
AE92B5E01C3FF73000968A3A = {
@@ -902,7 +893,6 @@
902893
buildActionMask = 2147483647;
903894
files = (
904895
AE8F49BA1C46A905009C1541 /* UIViewController+Extension.swift in Sources */,
905-
AE8F49B11C46A905009C1541 /* NSNotificationCenter+Block.swift in Sources */,
906896
AE8742751C7AE23E003A435C /* TSModel.swift in Sources */,
907897
AE8F49AE1C46A905009C1541 /* Device.swift in Sources */,
908898
AEBEE5B01C8754BD00956B0C /* TSChatButton+UI.swift in Sources */,
@@ -921,7 +911,6 @@
921911
AE87428C1C7B250D003A435C /* TSContactModel.swift in Sources */,
922912
AE69C7761C8E74A900D929CD /* TSMessageActionFloatView.swift in Sources */,
923913
AE8F49B61C46A905009C1541 /* UISearchBar+Extension.swift in Sources */,
924-
AE8F49B81C46A905009C1541 /* UIView+Extension.swift in Sources */,
925914
AE69C77A1C8F355700D929CD /* TSNavigationBar.swift in Sources */,
926915
AEE69BD01C81B58600C69224 /* TSChatShareMoreView.swift in Sources */,
927916
AEE69BB21C81B58600C69224 /* ChatConfig.swift in Sources */,
@@ -976,7 +965,6 @@
976965
AE8F49B51C46A905009C1541 /* UIScreen+Extension.swift in Sources */,
977966
AE92B7881C3FF7C900968A3A /* TSAppMacro.swift in Sources */,
978967
AEE69C181C81B92700C69224 /* UILabel+Extension.swift in Sources */,
979-
AEE69B641C81997500C69224 /* String+Extension.swift in Sources */,
980968
AEE69BD31C81B58600C69224 /* TSChatVoiceIndicatorView.swift in Sources */,
981969
AEBEE5AE1C8754BD00956B0C /* TSChatSystemEdgeLabel.swift in Sources */,
982970
AEE69BB91C81B58600C69224 /* TSYYTextLinePositionModifier.swift in Sources */,
@@ -1029,8 +1017,10 @@
10291017
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
10301018
CLANG_WARN_EMPTY_BODY = YES;
10311019
CLANG_WARN_ENUM_CONVERSION = YES;
1020+
CLANG_WARN_INFINITE_RECURSION = YES;
10321021
CLANG_WARN_INT_CONVERSION = YES;
10331022
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1023+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
10341024
CLANG_WARN_UNREACHABLE_CODE = YES;
10351025
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
10361026
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -1073,8 +1063,10 @@
10731063
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
10741064
CLANG_WARN_EMPTY_BODY = YES;
10751065
CLANG_WARN_ENUM_CONVERSION = YES;
1066+
CLANG_WARN_INFINITE_RECURSION = YES;
10761067
CLANG_WARN_INT_CONVERSION = YES;
10771068
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1069+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
10781070
CLANG_WARN_UNREACHABLE_CODE = YES;
10791071
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
10801072
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -1093,6 +1085,7 @@
10931085
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
10941086
MTL_ENABLE_DEBUG_INFO = NO;
10951087
SDKROOT = iphoneos;
1088+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
10961089
VALIDATE_PRODUCT = YES;
10971090
};
10981091
name = Release;
@@ -1101,6 +1094,7 @@
11011094
isa = XCBuildConfiguration;
11021095
baseConfigurationReference = FE685E6D2F38288FF2725A99 /* Pods-TSWeChat.debug.xcconfig */;
11031096
buildSettings = {
1097+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
11041098
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11051099
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
11061100
CODE_SIGN_IDENTITY = "iPhone Developer";
@@ -1123,6 +1117,7 @@
11231117
isa = XCBuildConfiguration;
11241118
baseConfigurationReference = 3A0A115624D01BDFF95A5161 /* Pods-TSWeChat.release.xcconfig */;
11251119
buildSettings = {
1120+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
11261121
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11271122
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
11281123
CODE_SIGN_IDENTITY = "iPhone Developer";

TSWeChat/Classes/Chat/Cells/TSChatSystemCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TSChatSystemCell: UITableViewCell {
5959
}
6060
var height: CGFloat = 0
6161
height += kChatInfoLabelMarginTop + kChatInfoLabelMarginTop
62-
let stringHeight: CGFloat = model.messageContent!.stringHeightWithMaxWidth(kChatInfoLabelMaxWdith, font: kChatInfoFont)
62+
let stringHeight: CGFloat = model.messageContent!.ts_heightWithConstrainedWidth(kChatInfoLabelMaxWdith, font: kChatInfoFont)
6363
height += stringHeight + kChatInfoLabelPaddingTop*2
6464
model.cellHeight = height
6565
return model.cellHeight

TSWeChat/Classes/Chat/ChatHelper/AudioFilesManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class AudioFilesManager {
2020

2121
- returns: 返回路径
2222
*/
23+
@discardableResult
2324
class func amrPathWithName(_ fileName: String) -> URL {
2425
let filePath = self.amrFilesFolder.appendingPathComponent("\(fileName).\(kAudioFileTypeAmr)")
2526
return filePath
@@ -33,6 +34,7 @@ class AudioFilesManager {
3334

3435
- returns: 返回路径
3536
*/
37+
@discardableResult
3638
class func wavPathWithName(_ fileName: String) -> URL {
3739
let filePath = self.wavFilesFolder.appendingPathComponent("\(fileName).\(kAudioFileTypeWav)")
3840
return filePath
@@ -47,6 +49,7 @@ class AudioFilesManager {
4749

4850
- returns: 目标路径
4951
*/
52+
@discardableResult
5053
class func renameFile(_ originPath: URL, destinationPath: URL) -> Bool {
5154
do {
5255
try FileManager.default.moveItem(atPath: originPath.path, toPath: destinationPath.path)
@@ -60,6 +63,7 @@ class AudioFilesManager {
6063
/**
6164
创建录音的文件夹
6265
*/
66+
@discardableResult
6367
class fileprivate func createAudioFolder(_ folderName :String) -> URL {
6468
let documentsDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
6569
let folder = documentsDirectory.appendingPathComponent(folderName)

TSWeChat/Classes/Chat/ChatHelper/AudioPlayManager.swift

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AudioPlayManager: NSObject {
2828
super.init()
2929
//监听听筒和扬声器
3030
let notificationCenter = NotificationCenter.default
31-
notificationCenter.addObserver(self, name: NSNotification.Name.UIDeviceProximityStateDidChange.rawValue, object: UIDevice.current, handler: {
31+
notificationCenter.ts_addObserver(self, name: NSNotification.Name.UIDeviceProximityStateDidChange.rawValue, object: UIDevice.current, handler: {
3232
observer, notification in
3333
if UIDevice.current.proximityState {
3434
do {
@@ -166,28 +166,7 @@ class AudioPlayManager: NSObject {
166166
log.info("Downloaded file successfully")
167167
self.convertAmrToWavAndPlaySound(audioModel)
168168
}
169-
170169
}
171-
172-
// Alamofire.download(.GET, audioModel.audioURL!, destination: destination)
173-
// .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in
174-
// print(totalBytesRead)
175-
//
176-
// // This closure is NOT called on the main queue for performance
177-
// // reasons. To update your ui, dispatch to the main queue.
178-
// dispatch_async(dispatch_get_main_queue()) {
179-
// log.info("Total bytes read on main queue: \(totalBytesRead)")
180-
// }
181-
// }
182-
// .response { [weak self] request, response, _, error in
183-
// if let error = error, let delegate = self!.delegate {
184-
// log.error("Failed with error: \(error)")
185-
// delegate.audioPlayFailed()
186-
// } else {
187-
// log.info("Downloaded file successfully")
188-
// self!.convertAmrToWavAndPlaySound(audioModel)
189-
// }
190-
// }
191170
}
192171
}
193172

TSWeChat/Classes/Chat/ChatHelper/ImageFilesManager.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Kingfisher
1717
class ImageFilesManager {
1818
let imageCacheFolder = KingfisherManager.shared.cache
1919

20+
@discardableResult
2021
class func cachePathForKey(_ key: String) -> String? {
2122
let fileName = key.ts_MD5String
2223
return (KingfisherManager.shared.cache.diskCachePath as NSString).appendingPathComponent(fileName)
@@ -35,6 +36,7 @@ class ImageFilesManager {
3536

3637
- returns: 目标路径
3738
*/
39+
@discardableResult
3840
class func renameFile(_ originPath: URL, destinationPath: URL) -> Bool {
3941
do {
4042
try FileManager.default.moveItem(atPath: originPath.path, toPath: destinationPath.path)

TSWeChat/Classes/Chat/TSChatViewController+Subviews.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ extension TSChatViewController {
4444
初始化操作栏
4545
*/
4646
fileprivate func setupActionBar(_ delegate: UITextViewDelegate) {
47-
self.chatActionBarView = TSChatActionBarView.fromNib()
47+
self.chatActionBarView = UIView.ts_viewFromNib(TSChatActionBarView.self)
4848
self.chatActionBarView.delegate = self
4949
self.chatActionBarView.inputTextView.delegate = delegate
5050
self.view.addSubview(self.chatActionBarView)
51-
self.chatActionBarView.snp_makeConstraints { [weak self] (make) -> Void in
51+
self.chatActionBarView.snp.makeConstraints { [weak self] (make) -> Void in
5252
guard let strongSelf = self else { return }
53-
make.left.equalTo(strongSelf.view.snp_left)
54-
make.right.equalTo(strongSelf.view.snp_right)
55-
strongSelf.actionBarPaddingBottomConstranit = make.bottom.equalTo(strongSelf.view.snp_bottom).constraint
53+
make.left.equalTo(strongSelf.view.snp.left)
54+
make.right.equalTo(strongSelf.view.snp.right)
55+
strongSelf.actionBarPaddingBottomConstranit = make.bottom.equalTo(strongSelf.view.snp.bottom).constraint
5656
make.height.equalTo(kChatActionBarOriginalHeight)
5757
}
5858
}
@@ -62,26 +62,26 @@ extension TSChatViewController {
6262
*/
6363
fileprivate func setupKeyboardInputView() {
6464
//emotionInputView init
65-
self.emotionInputView = TSChatEmotionInputView.fromNib()
65+
self.emotionInputView = UIView.ts_viewFromNib(TSChatEmotionInputView.self)
6666
self.emotionInputView.delegate = self
6767
self.view.addSubview(self.emotionInputView)
68-
self.emotionInputView.snp_makeConstraints {[weak self] (make) -> Void in
68+
self.emotionInputView.snp.makeConstraints {[weak self] (make) -> Void in
6969
guard let strongSelf = self else { return }
70-
make.left.equalTo(strongSelf.view.snp_left)
71-
make.right.equalTo(strongSelf.view.snp_right)
72-
make.top.equalTo(strongSelf.chatActionBarView.snp_bottom).offset(0)
70+
make.left.equalTo(strongSelf.view.snp.left)
71+
make.right.equalTo(strongSelf.view.snp.right)
72+
make.top.equalTo(strongSelf.chatActionBarView.snp.bottom).offset(0)
7373
make.height.equalTo(kCustomKeyboardHeight)
7474
}
7575

7676
//shareMoreView init
77-
self.shareMoreView = TSChatShareMoreView.fromNib()
77+
self.shareMoreView = UIView.ts_viewFromNib(TSChatShareMoreView.self)
7878
self.shareMoreView!.delegate = self
7979
self.view.addSubview(self.shareMoreView)
80-
self.shareMoreView.snp_makeConstraints {[weak self] (make) -> Void in
80+
self.shareMoreView.snp.makeConstraints {[weak self] (make) -> Void in
8181
guard let strongSelf = self else { return }
82-
make.left.equalTo(strongSelf.view.snp_left)
83-
make.right.equalTo(strongSelf.view.snp_right)
84-
make.top.equalTo(strongSelf.chatActionBarView.snp_bottom).offset(0)
82+
make.left.equalTo(strongSelf.view.snp.left)
83+
make.right.equalTo(strongSelf.view.snp.right)
84+
make.top.equalTo(strongSelf.chatActionBarView.snp.bottom).offset(0)
8585
make.height.equalTo(kCustomKeyboardHeight)
8686
}
8787
}
@@ -91,14 +91,14 @@ extension TSChatViewController {
9191
*/
9292
fileprivate func setupVoiceIndicatorView() {
9393
//voiceIndicatorView init
94-
self.voiceIndicatorView = TSChatVoiceIndicatorView.fromNib()
94+
self.voiceIndicatorView = UIView.ts_viewFromNib(TSChatVoiceIndicatorView.self)
9595
self.view.addSubview(self.voiceIndicatorView)
96-
self.voiceIndicatorView.snp_makeConstraints {[weak self] (make) -> Void in
96+
self.voiceIndicatorView.snp.makeConstraints {[weak self] (make) -> Void in
9797
guard let strongSelf = self else { return }
98-
make.top.equalTo(strongSelf.view.snp_top).offset(100)
99-
make.left.equalTo(strongSelf.view.snp_left)
100-
make.bottom.equalTo(strongSelf.view.snp_bottom).offset(-100)
101-
make.right.equalTo(strongSelf.view.snp_right)
98+
make.top.equalTo(strongSelf.view.snp.top).offset(100)
99+
make.left.equalTo(strongSelf.view.snp.left)
100+
make.bottom.equalTo(strongSelf.view.snp.bottom).offset(-100)
101+
make.right.equalTo(strongSelf.view.snp.right)
102102
}
103103
self.voiceIndicatorView.isHidden = true
104104
}

0 commit comments

Comments
 (0)