Latest 0.1.2
Homepage https://github.com/longhoang2984/LHIPhotoBrowser
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Photos
Authors

IPhotoBrowser

A simple iOS photo browser written in Swift.

CocoaPods Compatible
Swift 3.0

Requirements

  • iOS 8.0+
  • Swift 3.0+
  • ARC

install

CocoaPods

Adding the following to your Podfile and running pod install:

use_frameworks!
pod 'IPhotoBrowser'

import

import IPhotoBrowser

Usage

initialize

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

IPhotoBrowserDelegate

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

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

// 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, start: 0)
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?
}

Photos from

License

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

Latest podspec

{
    "name": "LHIPhotoBrowser",
    "version": "0.1.2",
    "summary": "A simple iOS Instagram photo browser written in Swift. - Main library in: https://github.com/hryk224/IPhotoBrowser",
    "homepage": "https://github.com/longhoang2984/LHIPhotoBrowser",
    "screenshots": "https://raw.githubusercontent.com/longhoang2984/LHIPhotoBrowser/master/sample1.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "longhoang2984": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/longhoang2984/LHIPhotoBrowser.git",
        "tag": "0.1.2"
    },
    "source_files": "Sources/*.{h,swift}",
    "frameworks": [
        "UIKit",
        "Photos"
    ],
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This