I started working with Firebase in my iOS App. I am trying to upload images to Firebase Storage. Fortunately, I was able to upload images to Firebase Storage using Swift 3. My issue is I always need to specify the name of the image in coding.
For e.g.:
let storage = FIRStorage.storage().reference(forURL:
gs://my_app_name.appspot.com/").child("images/new.jpg")
Here, new.jpg
is the image name. If I try to upload images multiple times, it gets replaced by the new image but the name remains the same. As a result I always get 1 item in my image folder.
All the example I have seen is for uploading for a single image. In my case the user can upload multiple images.
Is there any method or way so that every time I upload an image to Firebase it gets uploaded with a different image name. Or can I get the name of the image from the iPhone simulator?
Thanks in advance!