2017-07-30 73 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