     }
 }
 
+extension DemoViewController: DKPhotoGalleryDelegate {
+    func photoGallery(_ gallery: DKPhotoGallery, didShow index: Int) {
+        if let titleLabel = gallery.footerView as? UILabel {
+            if let title = gallery.items?[index].title {
+                titleLabel.text = title
+            } else {
+                titleLabel.text = nil
+            }
+        }
+    }
+}

                cell.contentLabel.text = imageURL.absoluteString
            } else if let videoURL = item.videoURL {
                cell.contentLabel.text = videoURL.absoluteString
            }
        }
        

                }
            }
        }

        gallery.footerView = footerViewForGallery()
        gallery.galleryDelegate = self
        
        return gallery
    }
    
    func footerViewForGallery() -> UIView {
        let titleLabel = UILabel()
        titleLabel.numberOfLines = 0
        titleLabel.backgroundColor = UIColor.clear
        titleLabel.textColor = UIColor.darkText
        titleLabel.textAlignment = .center
        titleLabel.font = UIFont(name: "Montserrat-Light", size: 12.0)
        titleLabel.frame = CGRect(x: 0, y: 0, width: self.view.bounds.width - 20, height: 40)
        return titleLabel
    }

    // MARK: - UIViewControllerPreviewingDelegate
    
    @available(iOS 9.0, *)
