title: Firebase retrieve autoId value in swift
body: <p>I would like to retrieve images values. Node look like this so, I would like to retrieve url1, url2, url3.</p>
  
  <pre><code> "Post": {
      "uid": {
        "Text": "some text",
        "images": {
           autoID1: url1,
           autoID2: url2,
           autoID3: url3
        }
      }
    }
  </code></pre>
  
  <p>The problem is that key is auto generated. So, I usually cast like this.</p>
  
  <pre><code>if let dictionary = snapshot.value as? [String:Anyobject] 
  let text = dictionary["text"] as? String
  </code></pre>
  
  <p>but in this case I don't know how to cast autoID key and get value.
  I tried code below but error said </p>
  
  <blockquote>
    <p>Could not cast value of type '__NSDictionaryM' (0x10af491c8) to
    'NSString' (0x10a0bad68).</p>
  </blockquote>
  
  <pre><code> func fetchImages() {
      ref.child("Post").child(uid!).child("images").observe(.value, with: { (snapshot) in
  
              let downloadUrl = snapshot.value as! String
              let stoRef = Storage.storage().reference(forURL: downloadUrl)
  
              stoRef.getData(maxSize: 1*1024*1024, completion: { (data, error) in
                  let pic = UIImage(data: data!)
                  self.imagesArray.append(pic!)
              })
  
      }, withCancel: nil)
  }
  </code></pre>
  
  <p>also if there are three url, should I use like <code>for snap in snapshot.children</code>  to loop through? How should I loop through those url and put into imagesArray?
  Thank you in advance!</p>