title: Swift: Searching Firebase Database for Users
body: <p>I have been looking all over the internet and Stack overflow but haven't found anything that I understood well enough to implement into my solution.
  There are many similar questions out there but none of the proposed solutions worked for me, so I'll ask you guys.</p>
  
  <p>How do I search my Firebase database for usernames in swift?
  In my app I have a view that should allow the user to search for friends in the database. Results should be updated in real time, meaning every time the user types or deletes a character the results should update. All I have so far is a UISearchBar placed and styled with no backend code.</p>
  
  <p>Since I don't really know what is needed to create such a feature it would be cool if you guys could tell me what you need to tell me exactly what to do. (Database Structure, Parts of Code...). I don't want to just copy and paste useless stuff on here.</p>
  
  <p>I would really appreciate the help.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is my database structure:</p>
  
  <pre><code>"users"
      "uid"   // Automatically generated
          "goaldata"
               "..."   // Not important in this case
          "userdata"
               "username"
               "email"
               "country"
               "..."  // Some more entries not important in this case
  </code></pre>
  
  <p>Hope I did it right, didn't really know how to post this on here.</p>