Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/3lvis/Viewer

Image viewer (or Lightbox) with support for local and remote videos and images
https://github.com/3lvis/Viewer

imageviewer ios lightbox swift viewer

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

![Viewer](https://raw.githubusercontent.com/3lvis/Viewer/master/GitHub/viewer-logo-2.jpg)









## Table of Contents

* [Features](#features)
* [Focus](#focus)
* [Browse](#browse)
* [Rotation](#rotation)
* [Zoom](#zoom)
* [tvOS](#tvos)
* [Setup](#setup)
* [Installation](#installation)
* [License](#license)
* [Author](#author)

## 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](https://github.com/3lvis/Viewer/blob/master/Source/Viewable.swift). Then, from your UICollectionView:

```swift
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

```ruby
pod 'Viewer'
```

### Carthage

```ruby
github "3lvis/Viewer"
```

## License

**Viewer** is available under the MIT license. See the [LICENSE](/LICENSE.md) file for more info.