title: When I tapped segment Odd or even I am getting true and false value in Tableview instead of odd value or even value
body: <p>When I press odd it shows true or false. How can Get values of array I'm trying to print odd value when i tap odd on segment or even values when i tap even , How can get this. I'm new in ios. Please help</p>
  <pre><code>class ViewController: UIViewController, UITableViewDelegate,UITableViewDataSource {
  
      @IBOutlet weak var tableView: UITableView!
      
      @IBOutlet weak var segmentOutlet: UISegmentedControl!
      let numberArray = Array(1...100)
      var segmentIndex  = 0
      
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view.
          tableView.delegate = self
          tableView.dataSource = self
      }
      @IBAction func segmentControl(_ sender: UISegmentedControl) {
          
  
          tableView.reloadData()
          
      }
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return numberArray.count
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell : TableViewCell = tableView.dequeueReusableCell(withIdentifier: &quot;cell&quot;) as! TableViewCell
          cell.numberLbl.text = String(numberArray[indexPath.row])
          if segmentOutlet.selectedSegmentIndex == 1 {
              cell.numberLbl.text = String(numberArray[indexPath.row] % 2 == 0)
              
          }
          if segmentOutlet.selectedSegmentIndex == 2 {
              cell.numberLbl.text = String(numberArray[indexPath.row] % 2 == 1)
          }
          
          return cell
      }
  }
  </code></pre>
  <p>my Simulator image:</p>
  <p><img src="https://i.stack.imgur.com/SDq8O.png" alt="code file" /></p>