Skip to content
/ Viewer Public
forked from 3lvis/Viewer

Image viewer (or Lightbox) with support for local and remote videos and images

License

Notifications You must be signed in to change notification settings

freyzou/Viewer

Repository files navigation

Viewer

From your UICollectionView:

override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
    guard let collectionView = self.collectionView else { return }

    let viewerController = ViewerController(initialIndexPath: indexPath, collectionView: collectionView, headerViewClass: HeaderView.self, footerViewClass: FooterView.self)
    viewerController.controllerDataSource = self
    self.presentViewController(viewerController, animated: false, completion: nil)
}

extension CollectionController: ViewerControllerDataSource {
    func viewerController(viewerController: ViewerController, itemAtIndexPath indexPath: NSIndexPath) -> ViewerItem {
        return self.photos[indexPath.row]
    }
}

About

Image viewer (or Lightbox) with support for local and remote videos and images

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 99.5%
  • Ruby 0.5%