title: (setValue:) Cannot store object of type _SwiftValue at pictureURL. Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray
body: <p>Having some issues understanding firebase with Swift 3.</p>
  
  <p>I've remade my observer to look like this:  </p>
  
  <pre><code>  currentUserFirebaseReference.observeSingleEvent(of: .value, with: { (snapshot: FIRDataSnapshot) in
              let UID = snapshot.key
  
     let dict = snapshot.value as! Dictionary&lt;String,AnyObject&gt;
     let pictureURL = dict["pictureURL"] as! String
  </code></pre>
  
  <p>I used to just do</p>
  
  <pre><code>observation..... in {
  
  let picture = snapshot.value!["pictureURL"]
  </code></pre>
  
  <p>But now I guess you have to explicitly tell Firebase that you're dealing with a Dictionary?</p>
  
  <p>My problem then comes when I'm trying to set a value.</p>
  
  <p>I'm adding the pictureURL from above to a Person class, and later I'm doing:</p>
  
  <pre><code> let picURL = self.currentUserInfo.pictureURL // The picture from before
  
    let info = ["pictureURL" : picURL, ....morestuff] as [String : Any] // Swift conversion added the String:Any bit. Assume this is correct?
  
  ref.setValue(info)
  </code></pre>
  
  <p>and I get this error: </p>
  
  <pre><code>Terminating app due to uncaught exception 'InvalidFirebaseData', reason: '(setValue:) Cannot store object of type _SwiftValue at pictureURL. Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray.
  </code></pre>
  
  <p>Why is this happening and how can I fix it?</p>
  
  <p>edit: </p>
  
  <p>So I found out this only happens when trying to pull info from a class.</p>
  
  <pre><code>    let data : Dictionary&lt;String, Any&gt; = ["Cats" : 3, "Dogs" : 9]
  
      DataService.ds.REF_BASE.child("testing").setValue(data)
  </code></pre>
  
  <p>The above code works.</p>
  
  <pre><code>   class Dog {
         var fur : String?
      }
  
      let dog = Dog()
      dog.fur = "Brown"
  
      let data : Dictionary&lt;String, Any&gt; = ["Cats" : 3, "Dogs" : 9, "DogFur" : dog.fur]
  
      DataService.ds.REF_BASE.child("testing").setValue(data)
  </code></pre>
  
  <p>That code crashes and says I can't assign a swiftvalue type.</p>