title: How can I use user input to name a child in Firebase?
body: <p>I'm trying to create a simple user database on Firebase for iOS. I have two textfields, one that takes the user's email address, and the other that takes the user's password. I want the email to be the user's uid. I try to accomplish this by creating a variable called "email" which I set equal to emailTextField.text! Then I implement the code that generates child(s) in Firebase, like so:</p>
  
  <pre><code>ref = Database.database().reference()
  
  ref.child("users").child(email).setValue(true)
  </code></pre>
  
  <p>Here's my problem: creating a child and naming it using a variable, doesn't work. I can do the following just fine:</p>
  
  <pre><code>ref.child("users").child("email")
  </code></pre>
  
  <p>but once I take away the quotation marks around "email" so that it becomes the variable, the program crashes. 
  How can I use user input to name a child in Firebase?</p>