Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
/ Viewer Public archive

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

License

Notifications You must be signed in to change notification settings

3lvis/Viewer

Repository files navigation

Viewer

Table of Contents

Features

Focus

Select an image to enter into lightbox mode.

Browse

Open an image or video to browse.

Rotation

Portrait or landscape, it just works.

Zoom

Pinch-to-zoom works seamlessly in images.

tvOS

Support for the Apple TV.

Setup

You'll need a collection of items that comform to the Viewable protocol. Then, from your UICollectionView:

import Viewer

override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    guard let collectionView = self.collectionView else { return }

    let viewerController = ViewerController(initialIndexPath: indexPath, collectionView: collectionView)
    viewerController.dataSource = self
    presentViewController(viewerController, animated: false, completion: nil)
}

extension CollectionController: ViewerControllerDataSource {
    func viewerController(_ viewerController: ViewerController, viewableAt indexPath: IndexPath) -> Viewable {
        return photos[indexPath.row]
    }
}

Installation

CocoaPods

pod 'Viewer'

Carthage

github "3lvis/Viewer"

License

Viewer is available under the MIT license. See the LICENSE file for more info.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages