ImageViewer.swift

An easy to use Image Viewer that is inspired by Facebook.

dark-mode

light-mode

auto-rotate

Supports

  • From iOS 10
  • Swift versions
    • Swift 4.0
    • Swift 4.2
    • Swift 5.0

Installation

Using cocoapods

pod 'ImageViewer.swift', '~> 3.0'
Ruby

How to use it

The simplest way to to use this is by using the UIImageView.setupImageViewer()

imageView.setupImageViewer()
Swift

Example:

import ImageViewer_swift

let imageView = UIImageView()
imageView.image = UIImage(named: 'cat1')
...
imageView.setupImageViewer()
Swift

Or you might load it from a URL

imageView.setupImageViewer(url: URL(string: "https://example.com/image.jpg")!)
Swift

Or you might load it with an array of images [UIImage]

let images = [
	UIImage(named: "cat1"),
	UIImage(named: "cat1"),
	UIImage(named: "cat1")
]
imageView.setupImageViewer(images: images)
Swift

Or you might load it with an array of URL [URL]

let urls = [
	URL(string: "https://example.com/your-image-1.jpg")!,
	URL(string: "https://example.com/your-image-2.jpg")!,
	URL(string: "https://example.com/your-image-3.jpg")!
]
imageView.setupImageViewer(urls: urls)
Swift

You could also check the Demo Project for more information.

GitHub

An easy to use Image Viewer that is inspired by FacebookRead More

Latest commit to the master branch on 8-14-2024
Download as zip