Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios MBCircularProgressBarView未在UITableViewCell中设置动画_Ios_Swift_Swift3 - Fatal编程技术网

Ios MBCircularProgressBarView未在UITableViewCell中设置动画

Ios MBCircularProgressBarView未在UITableViewCell中设置动画,ios,swift,swift3,Ios,Swift,Swift3,在WillDisplayCell中尝试此功能 //MARK: - TableView Delegate func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell( withIdentifier: "ListOfTaskTableViewCell",

在WillDisplayCell中尝试此功能

 //MARK: - TableView Delegate
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCell(
        withIdentifier: "ListOfTaskTableViewCell",
        for: indexPath) as! ListOfTaskTableViewCell

    //Configuare notification cell
    print(self.listItems.count)
    cell.lblName?.text = self.listItems[indexPath.row]
    cell.lblPersentage?.text = self.listPersentage [indexPath.row]
    cell.imgPersentageIcon?.image = UIImage(named: self.listIcons[indexPath.row])
    //Set as comment

    if self.floatPercentage[indexPath.row] >= 50.0 {
        cell.redProgressBar.isHidden = true
        UIView.animate(withDuration: 10.0, animations: {
            cell.greenProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
            }, completion: nil)

    }
    else{
        cell.greenProgressBar.isHidden = true

        UIView.animate(withDuration: 10.0, animations: {
            cell.redProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
            }, completion: nil)

    }                

    return cell
}
if self.floatPercentage[indexPath.row] >= 50.0 {
    cell.redProgressBar.isHidden = true
    UIView.animate(withDuration: 10.0, animations: {
        cell.greenProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
        }, completion: nil)

}
else{
    cell.greenProgressBar.isHidden = true

    UIView.animate(withDuration: 10.0, animations: {
        cell.redProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
        }, completion: nil)

}