LHIPhotoBrowser 0.1.3

LHIPhotoBrowser 0.1.3

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新版本2017年5月
SwiftSwift 版本3.0
SPM支持 SPM

Long Hoang 维护。




  • longhoang2984

IPhotoBrowser

一个使用 Swift 编写的简单的 iOS 相册浏览工具。

要求

  • iOS 8.0+
  • Swift 3.0+
  • ARC

安装

导入

import IPhotoBrowser

用法

初始化

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?
示例
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()

实体

IPhoto

struct IPhoto {
  let image: UIImage?
  let imageUrl: URL?
  let asset: PHAsset?
  let title: String?
  let description: String?
}

照片来源

许可证

该项目以 MIT 许可证提供。请参阅 LICENSE 文件获取详细信息。