title: FirebaseStorage: How to Delete Directory
body: <p>FirebaseStorage always returns error <code>400</code> when I try to delete a directory i.e. something like the following always returns error <code>400</code>.</p>
  
  <pre><code>let storageRef = FIRStorage.storage().reference().child("path/to/directory")
  storageRef.deleteWithCompletion { (error) in
      print("error: \(error)") // always prints error code 400
  }
  </code></pre>
  
  <p>However, deleting a file works fine e.g. something like doesn't return an error:</p>
  
  <pre><code>let storageRef = FIRStorage.storage().reference().child("path/to/file.jpg")
  storageRef.deleteWithCompletion { (error) in
      print("error: \(error)") // works fine, error is nil
  }
  </code></pre>
  
  <p>What could I be doing wrong here? I don't reckon it's not supported by FirebaseStorage because deleting files from a directory one by one would be pretty lame (specially if the said directory has 100s or 1000s of these).</p>