Code Monkey home page Code Monkey logo

tswechat's Introduction

TSWeChat

TSWeChat - A WeChat alternative, updated to Swift 5.       中文说明

Requirements

  • Cocoapods 1.2.0 +
  • iOS 10.0+ / Mac OS X 10.9+
  • Xcode 10.0+

Features

  • Send your rich text, expression, image and voice.
  • The cell image in TSChatImageCell is drawn by using Mask Layer . The chat background can be changed freely so that UI will look perfect.
  • Custom expression keyboard, custom tool keyboard.
  • Audio wav files can be automatically converted into amr files which facilite file transfer to Android devices. Both of the two type files have been doing cache.
  • When you tap the TSChatVoiceCell. It will automatically check the cache and download it by Alamofire.
  • When you send the image, it will be stored locally by using the caching mechanism of Kingfisher. After successfully uploaded, it will be automatically modified to image link's MD5 value file name.
  • The data are loaded from the JSON file. All the Models are created via ObjectMapper which is easy to convert model objects (classes and structs) from JSON.

Preview

Run pod install in the Terminal and then run TSWeChat.xcworkspace to see all the views.

Directory

Directory name Introduction
Classes To deposit different folders like ViewController, View. Sub directories are divided based on business logic, Such as Message,Address Book,Tabbar,Me,Login and etc, divided according to their functions.
Classes/CoreModule To deposit encapsulation of business logic of basic classes, like HttpManager, Models, ApplicationManager and etc.
General To deposit reused View and Class related with business logic, such as color extension.
Helpers Non-business logic extension, such as: UIView+Extension.swift, UIImage+Resize.swift and etc.
Macro To deposit macros and constant definitions used in the whole application, such as Notifications name , and the third party librarie's keys.
Resources Resources. Such as Assets.xcassets, Media.xcassets, JSON files, media files, plist files and etc.
Vendor To deposit the third party liabraries that cannot be installed by Cocoapods.
Supporting Files To deposit the original files
Scripts APNs script, export IPA file script and etc.
Sketch To deposit the original Sketch files. All the recourses in the project are come from the WeChat IPA folder, but some images I can't find. So I decided to do it myself. Yeah, I love design, sometimes coder become a designer is feeling good. XD

Vendor

See more details

License

TSWeChat is released under the MIT license. See LICENSE for details.

To Do

  • The custom photo album
  • WeChat custom ActionSheet
  • Long press the chat cell
  • The image viewer
  • Address book
  • GIF image cell in TSChatViewController
  • QRCodeViewController
  • ShakeViewController
  • Send my address
  • Video cell in TSChatViewController
  • TimelineViewController
  • Multilanguage support
  • And so on...

Contributing

  • All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting & todo task) are welcome. Let's make it better. XD

tswechat's People

Contributors

cdoky avatar emerson233 avatar hilen avatar j-em avatar jkaunert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tswechat's Issues

Error in running! How to solve this one?

/Users/macbookpro/Music/TSWeChat-master/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift:79:25: Value of type 'RxTime' (aka 'Date') has no member 'addingDispatchInterval'

/Users/macbookpro/Music/TSWeChat-master/Pods/RxSwift/RxSwift/Observables/Delay.swift:114:58: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'reduceWithSpanBetween'

/Users/macbookpro/Music/TSWeChat-master/Pods/RxSwift/RxSwift/Observables/Throttle.swift:74:53: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'reduceWithSpanBetween'

/Users/macbookpro/Music/TSWeChat-master/Pods/RxSwift/RxSwift/Observables/Throttle.swift:80:16: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'isNow'

音频录音下载出错

‼️‼️‼️ 2018-06-06 13:56:19.760 [Error] [main] [AudioPlayManager.swift:176] downloadAudio > Failed with error: responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.inputFileReadFailed(file:///private/var/mobile/Containers/Data/Application/E7830B0F-4BD0-44C0-AC2C-B6B45B4F667C/tmp/CFNetworkDownload_m5q8qZ.tmp)) ‼️‼️‼️

error: unknown argument: '-suppress-warnings'

您好!我是新手,编译时发现两个错误,都是一样的错误,发生在编译BSGridCollectionViewLayout 和Alamofire的时候。请问博主知道是什么原因吗?谢谢!
:0: error: unknown argument: '-suppress-warnings'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

录音过短时没有readyStopRecord

录音过短时没有stop recorder, 录音一直在录制,当超过60s时会回调stopRecord
if self.audioTimeInterval.int32Value > 60 { self.stopRecord() }
导致还会录音成功。

虽然在stopRecord里面调用了 self.operationQueue.cancelAllOperations() 如果录音时长小于0.5s时,但是子线程的while循环一直在跑,因为recorder.isRecording 是true
cancelAllOperations() 的文档是这样描述:
For operations that are already executing, the operation object itself must check for cancellation and stop what it is doing so that it can move to the finished state.

赞一个

这么大一个工程,不知道博主是在什么毅力下完成的,在下佩服!

ios9.3 code7.3 真机调试 编译不过,libopencore 非bitcode

`Ld /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Products/Debug-iphoneos/TSVoiceConverter/TSVoiceConverter.framework/TSVoiceConverter normal arm64
cd /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Products/Debug-iphoneos/TSVoiceConverter -L/Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Pods/TSVoiceConverter/Sources/lib -F/Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Products/Debug-iphoneos/TSVoiceConverter -filelist /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Intermediates/Pods.build/Debug-iphoneos/TSVoiceConverter.build/Objects-normal/arm64/TSVoiceConverter.LinkFileList -install_name @rpath/TSVoiceConverter.framework/TSVoiceConverter -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -Xlinker -no_deduplicate -fembed-bitcode-marker -lopencore-amrnb -lopencore-amrwb -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Intermediates/Pods.build/Debug-iphoneos/TSVoiceConverter.build/Objects-normal/arm64/TSVoiceConverter.swiftmodule -framework Foundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Intermediates/Pods.build/Debug-iphoneos/TSVoiceConverter.build/Objects-normal/arm64/TSVoiceConverter_dependency_info.dat -o /Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Build/Products/Debug-iphoneos/TSVoiceConverter/TSVoiceConverter.framework/TSVoiceConverter

ld: '/Users/joseph/Desktop/data/projects/react-native-project/PtApp/ios/Pods/TSVoiceConverter/Sources/lib/libopencore-amrnb.a(wrapper.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)`

AVFAudio`-[AVAudioSession setActive:withOptions:error:]:

录音时偶现的bug,在stackoverflow找到了原因,应该是录音和播放使用的同一个AVAudioSession,导致崩溃。解决方法是在AudioPlayManager的stopPlayer()方法中加一句代码self.audioPlayer!.prepareToPlay()重置AVAudioSession:
func stopPlayer() {
if self.audioPlayer == nil {
return
}
self.audioPlayer!.delegate = nil
self.audioPlayer!.stop()
self.audioPlayer!.prepareToPlay() //必须加上这一句,否则有可能会出现AVFAudio`-[AVAudioSession setActive:withOptions:error:]:的bug
self.audioPlayer = nil
UIDevice.current.isProximityMonitoringEnabled = false
}

pod install fail

[!] Unable to find a specification for TimedSilver (= 1.0.0)

mac os : 10.12.6
pod --version : 1.3.1

bug in extension TSChatViewController

        guard textView.text.componentsSeparatedByString(" ").count < textView.text.length else {
            TSProgressHUD.ts_showWarningWithStatus("不能发送空白消息")
            return
        }

can't input a character

新手求问

博主你好,我是一位新手,在看你的tswechat的时候,运行时发生这样的错误,请问该怎么解决呢?

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

pod两次了失败

[!] Error installing YYText
[!] /usr/local/bin/git clone https://github.com/ibireme/YYText.git /var/folders/4z/dctdgmh94j73gysppdm9lf5h0000gp/T/d20170223-2742-8sv9po --template= --single-branch --depth 1 --branch 1.0.7

Cloning into '/var/folders/4z/dctdgmh94j73gysppdm9lf5h0000gp/T/d20170223-2742-8sv9po'...
error: RPC failed; result=56, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

xcode10 跑不起来

使用xcode10打开项目,编译时报了35个错误,请问什么时候适配xcode10呢

表情位置问题

如题,在同一行内,微信内置表情(例如: [发怒] ),和文字不是同一水平线上的,表情看上去更高一些,或者说是表情显得更小一些。请问如何解决

xcode10.2.1无法编译

最新clone的code,并使用xcode10.2.1编译后仍旧有15个错误(基本都为pod中的),看到有帖子说已经针对xcode和swift进行了升级,请问是哪里还需要配置么?谢谢

Emotion inputs don't have content offset

simulator screen shot sep 3 2016 12 24 02 am

I pull requested a solution for #13 , but after the cell expanded and user keeps going, the text content should have moved up while keeping the cell height fixed at the max height.

关于导航侧滑

您好!消息列表进入房间后,侧滑返回失效,但偶尔可以成功侧滑。是什么原因呢?

无法运行在 Xcode 8.1, swift3 环境

Hi Hilen,
按照你所说,下载repo之后在项目下面运行 pod install,但是打开xcode的时候总是出现错误
screen shot 2016-11-29 at 12 07 02 pm
因为初学者,所以不是和你明白如何自行解决,貌似这个library是objective c,是不是需要在Xcode配置一些选项,谢谢啦。
Michael Chen

compilation error with bitcode

ld: 'TSWeChat-master/Pods/TSVoiceConverter/Sources/lib/libopencore-amrnb.a(wrapper.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think I have already disabled bitcode, but the error still exists.

聊天界面没有数据的时候菊花位置出现bug

一点击输入框弹出键盘后菊花就跑到输入框上方的位置,然后隐藏键盘后菊花才正常一点击输入框弹出键盘后菊花就跑到输入框上方的位置,然后隐藏键盘后菊花才正常,传不了图。。。

Xcode 10.3无法编译通过

macOS Mojave 10.14.6
Xcode 10.3

执行pod install后显示以下信息,这个步骤应该没有问题,版本看上去都是对的
Analyzing dependencies
Downloading dependencies
Using Alamofire (4.8.2)
Using BSGridCollectionViewLayout (1.2.3)
Using BSImagePicker (2.10.0)
Using BSImageView (1.0.3)
Using Dollar (9.0.0)
Using INTULocationManager (4.3.2)
Using KeychainAccess (3.2.0)
Using Kingfisher (5.7.0)
Using ObjcExceptionBridging (1.0.1)
Using ObjectMapper (3.5.1)
Using Reveal-SDK (4)
Using RxBlocking (5.0.0)
Using RxCocoa (5.0.0)
Using RxRelay (5.0.0)
Using RxSwift (5.0.0)
Using SVProgressHUD (2.0.4)
Using SnapKit (5.0.0)
Using SwiftyJSON (4.3.0)
Using TSVoiceConverter (0.1.6)
Using TimedSilver (1.2.0)
Using UIColor_Hex_Swift (5.1.0)
Using XCGLogger (7.0.0)
Using XLActionController (5.0.0)
Using YYText (1.0.7)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 20 dependencies from the Podfile and 24 total pods installed.

打开TSWeChat.xcworkspace,编译RxSwift的时候会报一些错误,导致后面无法编译通过,相关报错信息如下:

/Users/yanjiahua/LearningIOS/TSWeChat/Pods/RxSwift/RxSwift/Observables/Delay.swift:114:58: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'reduceWithSpanBetween'

/Users/yanjiahua/LearningIOS/TSWeChat/Pods/RxSwift/RxSwift/Observables/Throttle.swift:74:53: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'reduceWithSpanBetween'

/Users/yanjiahua/LearningIOS/TSWeChat/Pods/RxSwift/RxSwift/Observables/Throttle.swift:80:16: Value of type 'RxTimeInterval' (aka 'DispatchTimeInterval') has no member 'isNow'

/Users/yanjiahua/LearningIOS/TSWeChat/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift:79:25: Value of type 'RxTime' (aka 'Date') has no member 'addingDispatchInterval'

在网上查了有人碰到类似问题,删除Xcode缓存文件重启后解决问题,这边试了几次,还是无法解决,不知是否是Xcode新版本的问题

Performance anti-pattern in UI

Hello guys!

I found that in TSChatTimeCell and TSChatSystemCell, there are LabelViews with their background colors set to transparent (alpha between 0 and 1). I think it would be better not to use transparent or partially transparent views in repeating styles, like TableViewCells and inside for loops.

Due to my own experience and this Apple document, using transparency could be tricky, performance-wise.

Do you think it makes sense the code is refactored to improve performance?

录音时长问题

松开手指结束录音时,貌似是没有立即停止导致循环执行多了一遍
default

RxSwift某些方法不存在

下载下来重新pod之后,然后发现还是运行不了,提示RxSwift某些方法不存在,比如reduceWithSpanBetween reduceWithSpanBetween addingDispatchInterval

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.