UICollectionView image gallery app
I am not familiar with the Firebase or DKImagePickerController framework, so I cannot say anything
about that. But there are some things that I noticed:

There is no need in Swift to reference properties via self
(unless there is an ambiguity with a local variable, e.g. in an init
method). And you are not consistent here, e.g. both self.selectedItems
and selectedItems is used.



This

func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
    if imageDatas.count == 0 {
        return 0
    } else {
        return imageDatas.count
    }
}


can be simplified to

func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
    return imageDatas.count
}


And in 

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell


there is no need to check for imageDatas.count == 0 (and return a dummy cell in that case). If the array
is empty then numberOfItemsInSection returns zero, i.e. the
collection view displays no item at all and cellForItemAtIndexPath
will not be called.



If the order of the selected items is not relevant then you can
use a set instead of an array:

var selectedItems = Set&lt;NSIndexPath&gt;()


Adding or removing an index path then simplifies slightly to

if selectedItems.contains(indexPath) {
    cell.backgroundColor = UIColor.clearColor()
    selectedItems.remove(indexPath)
} else {
    cell.backgroundColor = UIColor.redColor()
    selectedItems.insert(indexPath)
}




A loop like

self.imageDatas = []
for key in self.keys {
    self.imageDatas.append(...)
}


can be replaced by a mapping:

self.imageDatas = self.keys.map { key in ... }