title: How can I parse a value (Stepper) from UITableViewCell to main View controller?
body: <p>I have a <code>UITableViewCell</code> and a <code>UIViewController</code>. In the <code>UITableViewCell</code> I have a stepper. How can I make it when user clicked the stepper to send the value to main view controller and receive it in my table view cell?</p>
  
  <p>I tried to get the value from stepper in the cell, but it just doesn't work. My code is bellow.</p>
  
  <p>First: UITableViewCell</p>
  
  <pre><code>import UIKit
  import HCSStarRatingView
  import GMStepper
  
  class FoodsSecoundTableViewCell: UITableViewCell {
      @IBOutlet weak var foodTitle: UILabel!
      @IBOutlet weak var foodPrice: UILabel!
      @IBOutlet weak var foodRating: HCSStarRatingView!
      @IBOutlet weak var foodImage: UIImageView!
      @IBOutlet weak var steperCount: GMStepper!
      var result : Double?
  
      override func awakeFromNib() {
          super.awakeFromNib()
          print(steperCount.value) // this line has print the value just one time
      }
  
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
      }
  
      @IBAction func myStepper(_ sender: Any) { // its a function         
      }
  
  }
  </code></pre>
  
  <p>Second: Main view controller</p>
  
  <pre><code>import UIKit
  
  class FoodsViewController: UIViewController , UITableViewDataSource {
  
      var foods = [Foods]()
  
      @IBOutlet weak var myTable: UITableView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          foods = [Foods(name: "myData", price: 15, count: 0, description: "myData", time: "20 - 30 min", rating: 4, image: #imageLiteral(resourceName: "chick")),
               Foods(name: "myData", price: 30, count: 0,description: "myData", time: "20 - 30 min", rating: 5, image: #imageLiteral(resourceName: "chick")),
               Foods(name: "myData", price: 20,count: 0,description: "myData", time: "20 - 30 min", rating: 3, image: #imageLiteral(resourceName: "chick")),
               Foods(name: "myData", price: 40,count: 0, description: "myData", time: "20 - 30 min", rating: 5, image: #imageLiteral(resourceName: "chick")),
               Foods(name: "myData", price: 55, count: 0,description: "myData", time: "20 - 30 min", rating: 4, image: #imageLiteral(resourceName: "chick"))
          ]
  
          myTable.rowHeight = 171
          myTable.dataSource = self
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return foods.count
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let food = foods[indexPath.row]
          let cell = tableView.dequeueReusableCell(withIdentifier: "foods")  as! FoodsSecoundTableViewCell
          cell.foodImage.image = food.image
          cell.foodPrice.text = String(food.price)
          print(cell.steperCount.value) // the result hear : its print just for one time
  
          cell.foodTitle.text = food.name
          cell.foodRating.value = CGFloat(food.rating)
          return cell
      }
  }
  </code></pre>