Tag: SWIFT uiprogressview

如何链接文件下载与进度视图

我下面的button代码从URL下载文件,我需要链接它与进度视图显示下载进度。 @IBAction func btnStream(sender: UIButton) { // First you need to create your audio url if let audioUrl = NSURL(string: "http://website.com/file.mp3") { // then lets create your document folder url let documentsUrl = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first as! NSURL // lets create your destination file url let destinationUrl = documentsUrl.URLByAppendingPathComponent(audioUrl.lastPathComponent!) println(destinationUrl) // to check if it […]