title: CollectionView cell inside UITableView is repeating
body: <p>I have one table view in which every cell contains one collection view!</p>
  
  <p>1) display only two cell in collectionview as my issue is when we scroll the tableview, collectoinview cell content is repeated in many other cell of tableview</p>
  
  <p>myCode:</p>
  
  <pre><code>let tags = Tblarr[indexPath.row]["hashtags"] as! [String]
      if tags.count != 0
      {
          for var i in 0 ... tags.count - 1
          {
              if i &lt; 2
              {
                  cell.tagsView.addTag(tags[i])
                  cell.collectionView.isHidden =   false
              }
          }
          if tags.count &gt; 2
          {
              cell.lblCount.isHidden = false
              cell.lblCount.text = "+\(tags.count - 2)"
          }
          else
          {
              cell.lblCount.isHidden = true
          }
      }
      else{
          cell.lblCount.isHidden = true
          cell.collectionView.isHidden =   true
      }
      cell.fillCollectionView(with: cell.tagsView.tags)
      cell.widthConstraint.constant = cell.collectionView.contentSize.width
  </code></pre>
  
  <p>here I get only fixed width of collectionview without setting width according to content size &amp; collectionview cells are repeated in other cell of tableview, even if cell is one , it will show 2 cell(when scrolled) </p>
  
  <p>when load for the first time</p>
  
  <p><img src="https://i.stack.imgur.com/cf7KP.png" alt="when load for the first time "></p>
  
  <p>when tableview is scrolled</p>
  
  <p><img src="https://i.stack.imgur.com/aPLIc.png" alt="when tableview is scrolled"></p>
  
  <p>//for storing array in collectionview from tableview</p>
  
  <pre><code>func fillCollectionView(with array: [String]) {
      self.collectionArr = array
      self.collectionView.reloadData()
  }
  </code></pre>