CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

PhotoBrowserKit 0.1.8

PhotoBrowserKit 0.1.8

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2018
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by smalldu.



  • By
  • smalldu

PhotoBrowserKit

CI Status
Version
License
Platform

Introduction

This project is highly imitate from KSPhotoBrowser - an Objective-C project
, I just rewrite some feature use Swift

It's smart and awesome !

demo

Example

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

Requirements

This library requires iOS 8.0+ and Xcode 8.0+

Installation

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

pod "PhotoBrowserKit"

Usage

var items: [ZYPhotoItem] = []
for i in 0..<urls.count {
  let cell = collectionView.cellForItem(at: IndexPath(row: i, section: 0)) as? PhotoCell
  // big url
  let bigUrl = urls[i].replacingOccurrences(of: "bmiddle", with: "large")
  let item = ZYPhotoItem()
  // imageView
  item.sourceView = cell?.imageView
  item.imageURL = URL(string: bigUrl)
  item.thunbImage = cell?.imageView.image
  items.append(item)
}
let browser = ZYPhotoBrowser(photoItems: items, selectedIndex: indexPath.row)
browser.showFromViewController(self)

Author

smalldu, [email protected]

License

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