title: How to return firebase data using a class?
body: <p>I have a UICollectionView where I populate data using a class. As of now, I am populating it with dummy data, as shown in the code below. I have trying to replace this dummy data with data from my Firebase database. </p>
  
  <pre><code>import UIKit
  
  class MrNobody
  {
  // MARK: - Public API
  var title = ""
  var description = ""
  var numberOfMembers = 0
  var numberOfPosts = 0
  var featuredImage: UIImage!
  
  init(title: String, description: String, featuredImage: UIImage!)
  {
      self.title = title
      self.description = description
      self.featuredImage = featuredImage
      numberOfMembers = 1
      numberOfPosts = 1
  }
  
  // MARK: - Private
  // dummy data
  static func createMrNobody() -&gt; [MrNobody]
  {
      return [
          MrNobody(title: "some text" , description: "some text", featuredImage: UIImage(named: "r1")!),
          MrNobody(title: "some text" , description: "some text", featuredImage: UIImage(named: "r1")!),
          MrNobody(title: "some text" , description: "some text", featuredImage: UIImage(named: "r1")!),
  
      ]
  }
  }
  </code></pre>
  
  <p>In order to include data, I have included <code>import Firebase</code>, identifying my firebase database using <code>let ref = Firebase(url: "my app url")</code> and reading data using</p>
  
  <pre><code> ref.observeEventType(.Value, withBlock: { snapshot in
  print(snapshot.value)
  }, withCancelBlock: { error in
  print(error.description)
  })
  </code></pre>
  
  <p>I am able to read the child data, but I am not being able to use it in the <code>return</code> block of the function. Ideally, I would want to use <code>enumerator = snapshot.childrenCount</code>, and reiteratively use the <code>return</code> function for as many children are there in the node of interest.</p>
  
  <p>Any help/direction will be greatly appreciated. </p>