title: want to add a collectionView inside tableView by downloading data from firebase to show . ios App Swift
body: <p>want to add a <code>UICollectionView</code> inside <code>UITableView</code> by downloading data from firebase to show 
      Now I'm done with the interface part, but I'm stuck in the problem, can't bring data from firebase to show in the <code>UICollectionView</code>.</p>
  
  <p>I can't run <code>collectionView.reloadData()</code> because the <code>UICollectionView</code> is different in class, how should I fix it?</p>
  
  <pre><code>func showImageRewardData(rewardID:String) {
          let databaseRef = Database.database().reference().child("reward").child(rewardID).child("rewardImage")
          databaseRef.observe(DataEventType.value, with: { (Snapshot) in
              if Snapshot.childrenCount&gt;0{
                  self.rewardDataArr.removeAll()
                  for rewardImage in Snapshot.children.allObjects as! [DataSnapshot]{
                      let rewardObject = rewardImage.value as? [String: AnyObject]
  
                      if(rewardObject?["imageURL"] != nil){
                          let imageUrl = rewardObject?["imageURL"]
                          let Data = rewardDetailClass(rewardImage: imageUrl as? String)
                          self.rewardDataArr.insert(Data, at: 0)          
                      }
  </code></pre>