2017-07-30 66 views
0

我想從firebase接收不同數量的圖像作爲.gif。我在tableView裏面使用了collectionView。在tableView中,我使用了名稱和地址,在collectionView中我使用了圖像。從firebase獲取陣列圖像

enter image description here

所以我需要接收圖像。例如:名字上需要接收image1和image2。在第二個名稱 - image1,image2,image3,image4,image5等等上爲下一個名稱。請檢查我的源代碼和firebase。

enter image description here

+0

遍歷和我的源代碼是在這裏https://github.com/denikaev/test2 –

回答

0

在火力,以接收陣列的鍵應該是零索引的序列號如下:

-photos 
    -0: "https://firebasestorage.googleapis..." 
    -1: "https://firebasestorage.googleapis..." 
    -2: "https://firebasestorage.googleapis..." 

這種方式可以有檢索數據時每個名稱的圖像的動態長度的數組從firebase。

但是,你正在做的方式會給你的圖像的字典,你需要使用

Array(dict.keys) // for Dictionary 

dict.allKeys // for NSDictionary