Ios MBCircularProgressBarView未在UITableViewCell中设置动画
在WillDisplayCell中尝试此功能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",
//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)
}