测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最新发布 | 2018年1月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 smalldu 维护。
此项目高度模仿自 KSPhotoBrowser - 一个 Objective-C 项目
,我只是使用 Swift
重写了部分功能
它很智能,很棒!
要运行示例项目,克隆仓库,然后首先在示例目录中运行 pod install
。
此库需要 iOS 8.0+ 和 Xcode 8.0+。
PhotoBrowserKit 通过 CocoaPods 可用。要安装它,只需将以下行添加到您的 Podfile 中:
pod "PhotoBrowserKit"
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)
smalldu, [email protected]
PhotoBrowserKit 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。