GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - prolificinteractive/Optik: A Swift library for displaying images from any source, local or remote.

BranchesTags
Open more actions menu

Latest commit

 

History

82 Commits
82 Commits

Folders and files

NameName
Last commit message
Last commit date
Example
Example
 
 
Images
Images
 
 
Optik
Optik
 
 
.gitignore
.gitignore
 
 
.swift-version
.swift-version
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
Optik.podspec
Optik.podspec
 
 
README.md
README.md
 
 
_Pods.xcodeproj
_Pods.xcodeproj
 
 

Repository files navigation

Optik

Travis build status Cocoapods Compatible Platform Docs

Description

Optik provides a simple viewing experience for a set of images, whether stored locally or remotely.

Requirements

  • iOS 9.0+
  • Xcode 8.1 or later

Installation

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

pod "Optik"

Usage

Optik can be used to display images stored either locally or remotely.

Displaying Images

Local Images

Local images can be displayed by creating an image viewer with an array of images:

let imageViewer = Optik.imageViewer(
    withImages: [
		UIImage(named: "image1.jpg")!,
		UIImage(named: "image2.jpg")!,
		UIImage(named: "image3.jpg")!
    ]
)

presentViewController(imageViewer, animated: true, completion: nil)

Remote Images

For remote images, an array of NSURLs should be provided - as well as an object conforming to the ImageDownloader protocol:

let imageDownloader = MyImageDownloader()

let imageViewer = Optik.imageViewer(
    withURLs: [
        NSURL(string: "https://somewebsite.com/image1.png")!,
        NSURL(string: "https://somewebsite.com/image2.png")!,
        NSURL(string: "https://somewebsite.com/image3.png")!
    ],
    imageDownloader: imageDownloader
)

presentViewController(imageViewer, animated: true, completion: nil)

Customizing the Image Viewer

Dismiss Button

The dismiss button image and position can be customized.

To indicate a custom dismiss button image, provide a dismissButtonImage parameter when creating an image viewer:

let imageViewer = Optik.imageViewer(
    withImages: [
        UIImage(named: "image1.jpg")!
    ],
    dismissButtonImage: UIImage(named: "MyDismissButton")
)

To indicate a position for the dismiss button, provide a dismissButtonPosition

let imageViewer = Optik.imageViewer(
    withImages: [
        UIImage(named: "image1.jpg")!
    ],
    dismissButtonImage: UIImage(named: "MyDismissButton"),
    dismissButtonPosition: .TopTrailing
)

Activity Indicator

When fetching remote images, an activity indicator is displayed while images are loaded. To indicate a custom activity indicator color, provide an activityIndicatorColor: parameter when creating an image viewer:

let imageViewer = Optik.imageViewer(
    withURLs: [
    	NSURL(string: "https://somewebsite.com/image1.png")!
    ],
    imageDownloader: imageDownloader,
    activityIndicatorColor: UIColor.redColor()
)

Contributing to Optik

To report a bug or enhancement request, feel free to file an issue under the respective heading.

If you wish to contribute to the project, fork this repo and submit a pull request. Code contributions should follow the standards specified in the Prolific Swift Style Guide.

License

prolific

Copyright (c) 2017 Prolific Interactive

Marker is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

About

A Swift library for displaying images from any source, local or remote.

Resources

Readme
MIT license
Activity
Custom properties

Stars

25 stars

Watchers

23 watching

Forks

13 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.