title: Cells Disappear when Scrolling a TableView (Swift)
body: <p>I am fairly new to Swift and am a bit confused. I have programmed my Firestore to load data into a TableView. However, when I scroll through the load data within the tableView, the cells within the tableView disappear. I have copied the code below of the logic and was wondering whether anyone knew why the code cells would disappear?</p>
  <p>I saw others asked this question but did not have much luck when I used their advice. Thank you!</p>
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          
          if(indexPath.row &gt; myRatingsRestaurant.count-1){
              return UITableViewCell()
                }
          
              else {
                  
              let cell = tableView.dequeueReusableCell(withIdentifier: &quot;MyRatingsViewCell&quot;, for: indexPath) as! MyRatingsViewCell
              cell.tag = indexPath.row
              let myRatingRestaurant = myRatingsRestaurant[indexPath.row] //Thread 1: Fatal error: Index out of range
              cell.set(myRatingRestaurant: myRatingRestaurant)
              return cell
                  
            }
      }
  </code></pre>