hilen / TSWeChat

A WeChat alternative. Written in Swift 5.
MIT License
3.77k stars 789 forks source link

赞一个 #7

Open panghaijiao opened 8 years ago

panghaijiao commented 8 years ago

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

hilen commented 8 years ago

多谢夸奖 :100:

Migoo-LiWB commented 8 years ago

我也佩服一个

发自我的 iPhone

在 2016年3月30日,00:14,庞海礁 notifications@github.com 写道:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

a132 commented 8 years ago

博主你好,首先十分感谢你的项目,我是一个swift的初学者,正在学习你的项目,我想问下[ChatModel] 的get方法是怎么定义的?问题是出现在TSChatViewController 里的itemDataSources中调用了get方法。希望能够得到你的指教,十分感谢

hilen commented 8 years ago

@a132 你说的 “ [ChatModel] 的 get 方法是怎么定义” 是什么意思?

a132 commented 8 years ago

感谢博主回复,我遇到的问题已经解决了,get方法是swift中每个数组都有的方法。应该是之前我的工程配置的问题,导致这个方法一直出错。不论如何,还是谢谢你。

wleofeng commented 8 years ago

我也是佩服

@hilen 我看了一下source code, 问一下博主,为什么都没怎么用auto layout?

hilen commented 8 years ago

@wleofeng 考虑到滚动帧率和性能问题,cell 里面没有用 AutoLayout。具体可以看这个:http://pilky.me/36/

wleofeng commented 8 years ago

@hilen 明白了。谢谢分享。 其实我也遇到过再cell 里面auto layout 会让frame rate 降到40,确实是有点要避免的地方。

tianlianjie commented 8 years ago

楼主 你好 执行 pod install --verbose的时候老是出错,有的sdk总是导入失败, 请问改怎么解决, 错误提示: -> Installing RxBlocking (2.3.1)

Git download Git download $ /Applications/Xcode.app/Contents/Developer/usr/bin/git clone https://github.com/ReactiveX/RxSwift.git /var/folders/xk/j3mr_wxs6gqdlw_dbr24c2zh0000gn/T/d20160909-11112-ql536f --template= --single-branch --depth 1 --branch 2.3.1 Cloning into '/var/folders/xk/j3mr_wxs6gqdlw_dbr24c2zh0000gn/T/d20160909-11112-ql536f'... fatal: unable to access 'https://github.com/ReactiveX/RxSwift.git/': Operation timed out after 0 milliseconds with 0 out of 0 bytes received

[!] Error installing RxBlocking [!] /Applications/Xcode.app/Contents/Developer/usr/bin/git clone https://github.com/ReactiveX/RxSwift.git /var/folders/xk/j3mr_wxs6gqdlw_dbr24c2zh0000gn/T/d20160909-11112-ql536f --template= --single-branch --depth 1 --branch 2.3.1

Cloning into '/var/folders/xk/j3mr_wxs6gqdlw_dbr24c2zh0000gn/T/d20160909-11112-ql536f'... fatal: unable to access 'https://github.com/ReactiveX/RxSwift.git/': Operation timed out after 0 milliseconds with 0 out of 0 bytes received

hilen commented 8 years ago

@tianlianjie pod 版本号是多少?

tianlianjie commented 8 years ago

1.0.1

hilen commented 8 years ago

我的版本号是 0.39.0 ,不确定这个问题是不是 RxBlocking 的支持问题,可以去 https://github.com/ReactiveX/RxSwift 这里看看。 另外看到有 unable to access 的信息,可能权限也有问题。

tianlianjie commented 8 years ago

哦 我再试试

tianlianjie commented 8 years ago

用vpn翻墙重新 pod install 一次,发现没问题了!

cabinwj commented 7 years ago
/**
 使用 Alamofire 下载并且存储文件
 */
fileprivate func downloadAudio(_ audioModel: ChatAudioModel) {
    let fileName = audioModel.keyHash!
    let filePath = AudioFilesManager.amrPathWithName(fileName)
    let destination: (URL, HTTPURLResponse) -> (URL) = { (temporaryURL, response)  in
        log.info("checkAndDownloadAudio response:\(response)")
        if response.statusCode == 200 {
            if FileManager.default.fileExists(atPath: filePath.path) {
                try! FileManager.default.removeItem(at: filePath)
            }
            log.info("filePath:\(filePath)")
            return filePath
        } else {
            return temporaryURL
        }
    }

    Alamofire.download(audioModel.audioURL!)
        .downloadProgress { progress in
            print("Download Progress: \(progress.fractionCompleted)")
        }
        .responseData { response in
            if let error = response.result.error, let delegate = self.delegate {
                log.error("Failed with error: \(error)")
                delegate.audioPlayFailed()
            } else {
                log.info("Downloaded file successfully")
                self.convertAmrToWavAndPlaySound(audioModel)
            }
        }
    }
}

TSWeChat/TSWeChat/Classes/Chat/ChatHelper/AudioPlayManager.swift:144:13: Initialization of immutable value 'destination' was never used; consider replacing with assignment to '_' or removing it

hilen commented 7 years ago

@wxm7075 是 warning 还是 error?