도래울

Swift image viewer 오픈소스 본문

개발/iOS

Swift image viewer 오픈소스

도래울 2016. 5. 10. 11:34

GSImageViewerController

Demo

Example

To show normal image viewer controller:

let imageInfo   = GSImageInfo(image: someImage, imageMode: .AspectFit)
let imageViewer = GSImageViewerController(imageInfo: imageInfo)
navigationController?.pushViewController(imageViewer, animated: true)

To show zoom transition image viewer controller:

let imageInfo      = GSImageInfo(image: someImage, imageMode: .AspectFill, imageHD: someHDImageURLOrNil)
let transitionInfo = GSTransitionInfo(fromView: someView)
let imageViewer    = GSImageViewerController(imageInfo: imageInfo, transitionInfo: transitionInfo)
presentViewController(imageViewer, animated: true, completion: nil)

Requirements

  • iOS 7.0+
  • Xcode 7.3 (Swift 2.2)

Installation

Embedded frameworks require a minimum deployment target of iOS 8.

To use GSImageViewerController with a project targeting iOS 7, you must to drag GSImageViewerController.swift to your iOS Project.

CocoaPods:

In your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod "GSImageViewerController"

And in your *.swift:

import GSImageViewerController

License

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

Comments