I want the progress bar to read whether the completed in my array has completed value ,If there is a strikethrough when done, the progress bar will also change

Sorry I may not be very clear but i want like the following

[![enter image description here](https://i.stack.imgur.com/CIA75.png)](https://i.stack.imgur.com/CIA75.png)

this is my code

```
   class ListTableViewController: UITableViewController {     

   @IBOutlet weak var progressView: UIProgressView!

   var progress: Float {
       if item.lists.count > 0 {
           return Float(item.lists.filter({$0.completed}).count) / Float(item.lists.count)
       } else {
           return 0
       }
   }

   var item: ItemCard! {
       didSet {
           if let progressView = progressView {
           // it's not work
           progressView.setProgress(progress, animated: true)
           }
       }
}

```

This is my data. There are lists = List in the ItemCard. I want to get completed in the list as the display of the progress bar.

```
class ItemCard: NSObject, Codable {

  var title: String
  var isFinish: Bool
  var lists = [List]()

  init(title: String, isFinish: Bool) {
      self.title = title
      self.isFinish = false
      super.init()
  }
  }

class List: NSObject, Codable {

  var name: String
  var completed:Bool

  init(name:String, completed:Bool) {
      self.name = name
      self.completed = completed
  } 
 }

```

I use didSet for item variables but it is not valid