在swift中的表格的单元格中添加ButtonDownload

时间:2017-08-20 08:14:02

标签: ios button download cell add

我想将DownloadButton添加到表格的单元格中进行下载。我添加了按钮成功按钮调用委托。那么,呼叫委托如何? 这是图书馆https://github.com/PavelKatunin/DownloadButton enter image description here

这是单元格中的代码。

class DownloadCell: UITableViewCell, PKDownloadButtonDelegate , PKDownloaderSimulatorDelegate {

@IBOutlet weak var lblLanguages: UILabel!
@IBOutlet weak var imgDownloaded: UIImageView!

var downloaderSimulator: PKDownloaderSimulator?
var pendingSimulator : PKDownloaderSimulator?





override func awakeFromNib() {
    super.awakeFromNib()

  startDownloadLanguage.delegate = self
    self.downloaderSimulator = PKDownloaderSimulator.init(progressInterval: 0.1)
    self.downloaderSimulator?.delegate = self;
    self.pendingSimulator = PKDownloaderSimulator.init(progressInterval: 0.05)
    self.pendingSimulator?.delegate = self;

}

override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)


}



@IBOutlet var startDownloadLanguage: PKDownloadButton!



func downloadButtonTapped(_ downloadButton: PKDownloadButton!, currentState state: PKDownloadButtonState) {
    //       
}


func simulator(_ simulator: PKDownloaderSimulator!, didUpdateProgress progress: Double) {

}

}

0 个答案:

没有答案