title: How to use multiple UITableView in single view Controller in iOS - Swift
body: <p>I am new to iOS development. Currently,  I am working on a project in which I use more than two <code>UITableView</code>s in a single view controller, but both data sources come from server one by one. When the first api hit, it shows the result, but after select item from that list I am unable to show the response in list.</p>
  <p>Here is my code:</p>
  <pre><code>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      print(&quot;sdfsdfsf&quot;)
      var count:Int?
      if tableView == self.pat_search_listview {
          count = serach_data.count
      }
      else  if tableView == self.visit_listview {
          count = all_vist_data.count
      }
      return count!
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = UITableViewCell()
      if tableView == self.pat_search_listview {
          cell.textLabel?.text = serach_data[indexPath.row].name + &quot;     &quot; + serach_data[indexPath.row].id
      }
          
          
      else  if tableView == self.visit_listview {
          print(&quot;second listview&quot;)
          cell.textLabel?.text = all_vist_data[indexPath.row].date
      }
      
      return cell
  }
  </code></pre>