title: Error in updating an array when a table view with two buttons is selected
body: <p>I have a tableview with two buttons and a label and I want to save the text in the label in two different arrays based on the button I select.</p>
  
  <p>| _Add Button_______Label______________Favourites Button___|
  | _Add Button_______Label______________Favourites Button___|</p>
  
  <p>When I select the add button I want the label to be saved in Add Button Array and when I select the Favorites Button I want to save the text in favorites. </p>
  
  <p>The code I did below works fine for the Add Button but always stores the first cell for the favorite button. What am I missing here?</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          var cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! SegmentControlCell
          cell.addPointsLabel.text? = SegmentNetworkCallObj.AFResponse[indexPath.row]["Description"] as? String ?? ""
          cell.addTaskButton.tag = indexPath.row
          cell.addTaskButton.addTarget(self, action: #selector(addButtontapped(_:)), for: .touchUpInside)
          cell.addTaskButton.addTarget(self, action: #selector(favouriteButtonTapped(_:)), for: .touchUpInside)
              return cell
          }
  
  //Button Selection
  @IBAction func addButtontapped(_ sender: Any) {
          let selectedTask = SegmentNetworkCallObj.AFResponse[(sender as AnyObject).tag]["Description"]
          dailyDeedsArray.append(selectedTask as! String)
          print("addbutton",dailyDeedsArray)
  }
  
      @IBAction func favouriteButtonTapped(_ sender: Any) {
          let selectedTask = SegmentNetworkCallObj.AFResponse[(sender as AnyObject).tag]["Description"]
          favouritesArray.append(selectedTask as! String)
          print("favourites",favouritesArray)
  
      }
  </code></pre>