Skip to content
Image viewer (or Lightbox) with support for local and remote videos and images
Branch: master
Clone or download
Latest commit 2b1f83e Apr 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Update CircleCI Apr 17, 2019
Assets Feature: seek videos (#90) Dec 17, 2016
Demo.xcodeproj Convert to Swift 5 Apr 17, 2019
GitHub Add Bakken & Bæck logo Mar 29, 2017
Library Convert to Swift 5 Apr 17, 2019
Resources/SharedAssets.xcassets Migrate to Swift 3.1 Mar 29, 2017
Source Convert to Swift 5 Apr 17, 2019
Tests Run SwiftFormat Dec 8, 2016
iOS Swift 5 changes Apr 17, 2019
tvOS Convert to Swift 5 Apr 17, 2019
.gitignore Feature/pinch to zoom (#44) Jun 27, 2016
.swift-version Convert to Swift 5 Apr 17, 2019
CHANGELOG.md Rename Dec 14, 2018
CONTRIBUTING.md Rename Dec 14, 2018
LICENSE.md Rename Dec 14, 2018
Package.swift Rename Dec 14, 2018
README.md Drop Author section Dec 14, 2018
Viewer.podspec Convert to Swift 5 Apr 17, 2019

README.md

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.

You can’t perform that action at this time.