I am trying to learn firebase.I have two folders on firebase
1)VDBackgroundFrames/ 2)VDFrames/
In both folders ,we have 4 images - VDBG2.png,VDBG3.png,VDBG4.png,VDBG5.png.
I am able to access one image at a time from firebase using the following code:-
func firebaseSetUp(){
let store = Storage.storage()
let storeRef = store.reference()
let userProfilesRef = storeRef.child("VDBackgroundFrames/VDBG11.jpg")
userProfilesRef.downloadURL { (url,error) in
if error != nil {
print("error?.localizedDescription",error?.localizedDescription)
return
}else{
print("url",url!)
}
}
}
//==========updated code ====//
func firebaseSetUp(){
let store = Storage.storage()
let storeRef = store.reference()
let userProfilesRef = storeRef.child("VDBackgroundFrames/")
userProfilesRef.observe(.childAdded, with: { [weak self] (snapshot) -> Void in
guard let strongSelf = self else { return }
//Logic to extract urls...
}, changeHandler: (StorageReference, NSKeyValueObservedChange<Value>) -> Void)
}
Output that I am obtaining is as follows:-
URL
I actually want to access all the 4 images together from folder VDBackgroundFrames & VDFrames respectively.Kindly suggest the possible way to do it.Any suggestion or guidance would be apprecialble. Thanks in advance.