title: Retrieving Data using Firebase Swift
body: <p>I'm using Firebase for my Swift iOS application. I found the retrieving data tutorial on Firebase's guide a bit confusing and I am not sure why when I try to access existing values in my database results in nil values.</p>
  
  <p>This is what I have so far:  </p>
  
  <pre><code>usersRef.queryOrderedByChild("fbid").queryEqualToValue(userId).observeSingleEventOfType(.Value, withBlock:{ snapshot in
                          print("SNAPSHOT: ",snapshot.value)
  </code></pre>
  
  <p>Here is the result of printing snapshot.</p>
  
  <pre><code>SNAPSHOT:  {
      1 = {
          fbid = 1;
          firstName = Michelle;
          friendlist =         {
              9 = "Kevin C";
          };
          lastName = C;
          profilepicurl = "https:;
          uid = "facebook:1";
      };
  }
  </code></pre>
  
  <p>However, the line below results in:<br>
  fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  
  <pre><code> firstName = snapshot.value.objectForKey("firstName") as! String
  </code></pre>
  
  <p>I would like to retrieve all the values for the user (firstName, profilepicurl, friendlist, etc) and store them in variables. It seems simple but perhaps I'm missing something. Any help would be appreciated. </p>