【发布时间】:2014-12-26 04:03:25
【问题描述】:
我正在尝试在将资产上传到 S3 存储桶时更新进度视图,如下所示:
myTransferManager.upload(myTransferManagerRequest).continueWithExecutor(myDefaultThreadBFExecutor, withBlock: { (myBFTask) -> AnyObject! in ... etc etc.
但是,我不知道如何在请求上传时获取完成百分比。我遇到过几次这种委托方法:
-(void)request:(AmazonServiceRequest *)request didSendData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite: (NSInteger)totalBytesExpectedToWrite
{
}
但是我的项目是用 Swift 编写的,我还没有弄清楚如何实现它。作为参考,我在这里遇到了这种方法:http://mobile.awsblog.com/post/TxIRFEQTW9XU8G/S3TransferManager-for-iOS-Part-I-Asynchronous-Uploads 和这里:Uploading to Amazon-S3 via AFNetworking
任何提示将不胜感激!
干杯, 布伦丹
【问题讨论】:
标签: ios swift amazon-web-services amazon-s3 progress-bar