gpt4 book ai didi

Swift Dropbox 进度条

转载 作者:行者123 更新时间:2023-11-30 13:59:12 25 4
gpt4 key购买 nike

我正在开发一个快速应用程序,将图像上传到 Dropbox 客户端上传进程工作正常我只是想显示上传进度

谢谢你的帮助

  func uplodeimage(filePath : String , fileData : NSData)
{

let client = Dropbox.authorizedClient ;

client?.filesUpload(path: filePath, body: fileData).progress({ (bytesWritten : Int64, totalBytesWritten : Int64, totalBytesExpectedToWrite : Int64) -> Void in


let uplodProgress : Float = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) as Float;


dispatch_async(dispatch_get_main_queue(), { () -> Void in

self.progressbar.progress = uplodProgress
self.progressLabil.text = "\(uplodProgress * 100)%"
self.loadingIndicator.stopAnimating();
self.loadingIndicator.removeFromSuperview();
self.loginBtn.enabled = true ;
self.uplodBtn.enabled = true;

});




});


}

不是说客户端上传进度是dropbox功能

最佳答案

你可以试试这个:

dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.progressBar.setProgress(Float(totalBytesWritten)/Float(totalBytesExpected), animated: true)
});

关于Swift Dropbox 进度条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33198783/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com