Latest 0.1.3
License MIT
Platforms ios 9.0

[![CI Status]( Gregory/ExhibitionSwift.svg?style=flat)]( Gregory/ExhibitionSwift)


  • Swift 3
  • = iOS 7


ExhibitionSwift is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ExhibitionSwift"


To run the example project, clone the repo, and run pod install from the Example directory first.


Image gallerys mostly seem to have been built with a certain perogative. Some are designed for locally stored images, others for remote only. Some force upon you a features you might not want – like share button, while others with non-customizable UI elements. Some maintain a static group of images only and others do allow you to add – but to not remove!

My goal in Exhibition was to design an image gallery that’s simple to integrate, elegant to use and easily customizable to your app’s design.



Begin by setting up your controller with a configuration object.

let config = ExhibitionConfig() 

There are four buttons in each corner and a page control. Customize to your liking.

config.swButton.image = UIImage(named: "deleteButton")
config.swButton.imageHighlighted = UIImage(named: "deleteButtonHighlighted")
config.seButton.image = UIImage(named:"addButton")
config.swButton.imageHighlighted = UIImage(named: "addButtonHighlighted")
config.nwButton.hidden = true
config.neButton.title = "Exit"
config.generalTheme.errorImage = UIImage(named: "failedToLoadImage")
config.generalTheme.backgroundColor = .black
config.generalTheme.foregroundColor = .white
config.buttonsTheme.buttonsTitleColor = .red
config.buttonsTheme.buttonsTitleColorHighlighted = .orange


You can write your own Image Networking class by subscribing to ExhibitionDownloaderProtocol, or use the built in ExhibitionDownloader.

public protocol ExhibitionDownloaderProtocol {
    func downloadImage(image: ExhibitionImageProtocol, results: @escaping ((UIImage?, Error?)->()))

Image Cache

You can write your own Image Cache or integrate with your existing one by subscribing to ExhibitionCacheProtocol, or use the built in ExhibitionCache.

public protocol ExhibitionCacheProtocol {
    func set(image img:UIImage, forKey key: String)
    func retrieveImage(forKey key: String) -> UIImage?

Exhibition Images

You can integrate the ExhibitionImageProtocol directly into your models or use the built in ExhibitionImage struct.

public protocol ExhibitionImageProtocol {
    var image: UIImage? { get }
    var url: URL? { get }
    var shouldCache: Bool { get }

// OR

var imgs: [ExhibitionImageProtocol] = [
  ExhibitionImage(string: "")!,
  ExhibitionImage(string: "'s_Very_Large_Telescope.jpg")!,
  ExhibitionImage(string: "")!,
  ExhibitionImage(string: "")!,
  ExhibitionImage(string: "")!,
  ExhibitionImage(string: "")!

  ExhibitionImage(url: URL)
  ExhibitionImage(image: UIImage)

Finally, build a ExhibitionController.

let controller = ExhibitionController(with: requiredImages,
                                      config: optionalConfig,
                                      cache: optionalCache,
                                      downloader: optionalDownloader

Give your buttons something to do.

controller.neClosure = { button, controller in
  controller.dismiss(animated: true, completion: nil)

controller.swClosure = { button, controller in
  let newImageURL = URL(string: "")!
  let img = ExhibitionImage(url: newImageURL)
  controller.append(exhibitionImage: img, scrollToLast: true)

closure.seClosure = { button, controller in
  _ = controller.removeCurrentExhibitionImage() 

You can even design your own custom UIView subclass activity indicator if you subsribe to ExhibititionActivityIndicatorViewProtocol by overriding the newActivityView closure:

public var newActivityView: ActivityViewGenerator = { controller, sized in
  // return <ExhibititionActivityIndicatorViewProtocol>

public typealias ActivityViewGenerator = (_ controller: ExhibitionController, _ sized: CGSize) -> (ExhibititionActivityIndicatorViewProtocol)


Exhibition is currently in Beta and will continue to be developed in the coming months. It has not been tested at industry scale, use at your own risk.


Eli Gregory, [email protected]


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

Latest podspec

    "name": "ExhibitionSwift",
    "version": "0.1.3",
    "summary": "Exhibition is a mutable asynchronous image gallery that makes no assumptions.",
    "description": "Exhibition is a mutable asynchronous image gallery that makes no assumptions. Exhibition does not assume what you want to do you with your image gallery but instead extends to you full and easy control mechanisms. Load an image from disk or remote url, add and delete images at will. Customize the UI.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Eli Gregory": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.3"
    "platforms": {
        "ios": "9.0"
    "source_files": "ExhibitionSwift/Classes/**/*",
    "resource_bundles": {
        "ExhibitionSwift": [
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This