IPhotoBrowser 0.6.0

IPhotoBrowser 0.6.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Feb 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by hryk224.




  • By
  • hyyk224

IPhotoBrowser

A simple iOS Instagram photo browser written in Swift.

Requirements

  • iOS 8.0+
  • Swift 3.0+
  • ARC

install

import

import IPhotoBrowser

Usage

initialize

init(images: [UIImage], start index:Int)
init(imageUrls: [URL], start index:Int)
init(assets: [PHAsset], start index:Int)

IPhotoBrowserDelegate

func iPhotoBrowser(_ iPhotoBrowser: IPhotoBrowser, didChange index: Int)

// Present/Dismiss
@objc optional func iPhotoBrowserDidDismissing(_ iPhotoBrowser: IPhotoBrowser)
@objc optional func iPhotoBrowserDidCanceledDismiss(_ iPhotoBrowser: IPhotoBrowser)

// Push/Pop
@objc optional func iPhotoBrowserDidPop(_ iPhotoBrowser: IPhotoBrowser)
@objc optional func iPhotoBrowserDidCanceledPop(_ iPhotoBrowser: IPhotoBrowser)
/// This screenshot is used for pop transitions.
/// Used background image to IPhotoBrowser.
@objc optional func iPhotoBrowserMakeViewScreenshotIfNeeded(_ iPhotoBrowser: IPhotoBrowser) -> UIImage?
Example
let photoBrowser = IPhotoBrowser(images: images.objects, start: indexPath.item)
photoBrowser.delegate = self
navigationController?.pushViewController(photoBrowser, animated: true)
or
present(photoBrowser, animated: true, completion: nil)

IPhotoBrowserAnimatedTransitionProtocol

var iPhotoBrowserSelectedImageViewCopy: UIImageView? { get }
var iPhotoBrowserDestinationImageViewSize: CGSize? { get }
var iPhotoBrowserDestinationImageViewCenter: CGPoint? { get }
func iPhotoBrowserTransitionWillBegin()
func iPhotoBrowserTransitionDidEnded()

Entity

IPhoto

struct IPhoto {
  let image: UIImage?
  let imageUrl: URL?
  let asset: PHAsset?
  let title: String?
  let description: String?
}
init(photos: [IPhoto], start index:Int)

Photos from

License

This project is made available under the MIT license. See LICENSE file for details.