title: Send Firebase data from Main View Controller to Detailed View Controller
body: <p>I was able to create a UICollection View feed similar to Instagram but I am not sure how to select the cells and go to a more detailed view controller. Here are what my main view controller looks like. '</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  
  
  
      performSegue(withIdentifier: "details", sender: self)
      }
  
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      if segue.identifier == "details" {
  
  
          if let indexPaths = self.collectionView!.indexPathsForSelectedItems{
  
      let vc = segue.destination as! MainViewController
      let indexPath = indexPaths[0] as NSIndexPath
      let post = self.posts[indexPath.row] as! [String: AnyObject]
          let Booked = post["title"] as? String
          let Authors = post["Author"] as? String
          let ISBNS = post["ISBN"] as? String
          let Prices = post["Price"] as? String
          let imageNames = post["image"] as? String
          vc.Booked = Booked
          vc.Authors = Authors
          vc.ISBNS = ISBNS
          vc.Prices = Prices
          vc.imageNames = imageNames
  
              print(indexPath.row)
  
  
          }  }}
  </code></pre>
  
  <p>Here is what my database looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/l4oI6.png" alt="1"></p>
  
  <pre><code>    //Detailed View Controller
      FIRDatabase.database().reference().child("posts").child(self.loggedInUser!.uid).observeSingleEvent(of: .value, with: { (snapshot:FIRDataSnapshot) in
          if let dictionary = snapshot .value as? [String: AnyObject] {
              self.BookTitle.text = dictionary["title"] as? String
              self.Author.text = dictionary["Author"] as? String
              self.ISBN.text = dictionary["ISBN"] as? String
              self.Price.text = dictionary["Price"] as? String
              self.Image.image = ["image"] as? UIImage  
          }
      })  
  </code></pre>
  
  <p>Above is my detailed view controller. However, when I click the cells, my information is not passed</p>