title: How to get the error "Fatal error: Index out of range" while retrieving data from Firestore?
body: <p>I am retrieving user data from two different collection for different cells, I am able to retrieve data but able to set the data to one cell of</p>
  
  <pre><code>  override func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return 1 + posts.count
      }
  
  
  override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          if indexPath.row == 0 {
              let cell = tableView.dequeueReusableCell(withIdentifier: "detailscell") as! DetailsCellInHomeScreen
              if let imageURL = currentUserImageUrl {
                  cell.configCell(userImgUrl: imageURL)
                  cell.shareBtn.addTarget(self, action: #selector(toCreatePost), for: .touchUpInside)
              }
              cell.set(details: details[indexPath.row])
              return cell
          }
  
          let cell = tableView.dequeueReusableCell(withIdentifier: "postCell", for: indexPath) as! PostTableViewCell
  
          cell.btnComment.tag = indexPath.row
          cell.btnComment.addTarget(self, action: #selector(toComments(_:)), for: .touchUpInside)
  
          cell.favoritebutton.tag = indexPath.row
          cell.favoritebutton.addTarget(self, action: #selector(favupdate(_:)), for: .touchUpInside)
          cell.set(post: posts[indexPath.row - 1])
          return cell
      }
  </code></pre>
  
  <p>getting error at this line </p>
  
  <pre><code>cell.set(details: details[indexPath.row])
  </code></pre>