TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by CoderJianfeng.
由于当前仓库存在gif图,下载包较大,请点击下面的【下载源代码】极速下载哦,源代码下载方码云
let browser = LLPhotoBrowserViewController.init(photoArray: data, currentIndex: indexPath.row, sheetTitileArray: ["分享给朋友","保存到相册"], isOpenQRCodeCheck: true) { (index, imageView, qrcodeString) in
print("ActionSheet点击-->下标=\(index); ImageView:\(imageView); qrcodeString:\(String(describing: qrcodeString))")
if let qrcode = qrcodeString {
UIAlertView.init(title: "二维码地址", message: qrcode, delegate: self, cancelButtonTitle: "取消").show()
}
}
browser.presentBrowserViewController()
let browser = LLPhotoBrowserViewController.init(photoArray: data currentIndex: indexPath.row)
// 模态弹出
browser.presentBrowserViewController()
let browser = LLPhotoBrowserViewController.init(photoArray: data, currentIndex: indexPath.row, sheetTitileArray: ["分享给朋友","保存到相册"]) { (index, imageView, qrcodeString) in
print(index)
}
// 模态弹出
browser.presentBrowserViewController()
版本信息 | 更新描述 |
---|---|
1.1.0 | * 优化关于图片不在可视区域的图片消失 |
1.0.9 | * Swift 4 |
1.0.8 | * Swift 3 |
1.0.7 | * 修复单击退出时的快速滚动崩溃错误 |
1.0.6 | * 增加ActionSheet的自定义样式 |
1.0.5 | * 修复不使用长按后的闪退问题 |
1.0.4 | * Add Open |
1.0.3 | * 修复Pod后提示性图片不显示 |
1.0.2 | * 增加图片中二维码检测,目前仅支持单个链接二维码 |
1.0.1 | * 增加支持网络图,本地图,UIImage同时使用 * HTTPString, UIImage, 文件名称String |
1.0.0 | * 项目初始化 |
pod 'LLPhotoBrowser'
to your Podfile.
pod 'LLPhotoBrowser', '1.0.8'
pod 'LLPhotoBrowser'
或者 pod 'LLPhotoBrowser', '~> 1.1.0'
pod install
or pod update
.import LLPhotoBrowser
var data: [LLBrowserModel] = []
for index in 0..<bigUrlArray1_0_1.count {
let cell: LLCollectionViewCell? = collectionView.cellForItem(at: IndexPath.init(row: index, section: 0)) as? LLCollectionViewCell
let model = LLBrowserModel.init()
model.data = bigUrlArray1_0_1[index]
if let c = cell {
model.sourceImageView = c.ll_imageView
}
data.append(model)
}
let browser = LLPhotoBrowserViewController.init(photoArray: <#数组([LLBrowserModel])#>, currentIndex: <#当前索引(row)#>)
// 模态弹出
browser.presentBrowserViewController()
let browser = LLPhotoBrowserViewController.init(photoArray: <#数组([LLBrowserModel])#>, currentIndex: <#当前索引(row)#>, sheetTitileArray: <#工具菜单标题([String])#>) { (<#点击工具菜单下标#>, <#当前显示的imageView#>, <#二维码结果返回#>) in
// 点击事件处理
print("ActionSheet点击-->下标=\(index)")
}
// 模态弹出
browser.presentBrowserViewController()
/// 1.0.1版本 数据源
let bigUrlArray1_0_1: [Any?] = [ "http://car0.autoimg.cn/upload/spec/5900/1024x0_1_q87_2011071303265437981.jpg",
// 文件名称
"timg",
"timg-1",
// URL
"http://img1a.xgo-img.com.cn/pics/2153/b2152556.jpg",
"http://4493bz.1985t.com/uploads/allimg/140826/3-140R6142K1.jpg",
// UIImage
UIImage.init(named: "timg-5"),
UIImage.init(named: "timg-7"),
// URL
"http://4493bz.1985t.com/uploads/allimg/140825/3-140R5115546.jpg"]
let browser = LLPhotoBrowserViewController.init(photoArray: data, currentIndex: indexPath.row, sheetTitileArray: ["分享给朋友","保存到相册"], isOpenQRCodeCheck: true) { (index, imageView, qrcodeString) in
print("ActionSheet点击-->下标=\(index); ImageView:\(imageView); qrcodeString:\(String(describing: qrcodeString))")
if let qrcode = qrcodeString {
UIAlertView.init(title: "二维码地址", message: qrcode, delegate: self, cancelButtonTitle: "取消").show()
}
}
browser.presentBrowserViewController()
/// Cell Height default 44.0
open var actionSheetCellHeight: CGFloat? = 44.0
/// Cell Background Color default white
open var actionSheetCellBackgroundColor: UIColor? = UIColor.white
/// Title Font default UIFont.systemFont(ofSize: 15.0)
open var actionSheetTitleFont: UIFont? = UIFont.systemFont(ofSize: 15.0)
/// Title Color default black
open var actionSheetTitleTextColor: UIColor? = UIColor.black
/// Cancel Color default black
open var actionSheetCancelTextColor: UIColor? = UIColor.black
/// Cancel Title default 取消
open var actionSheetCancelTitle: String? = "取消"
/// Line Color default 212.0 212.0 212.0
open var actionSheetLineColor: UIColor? = UIColor.init(red: 212.0/255.0, green: 212.0/255.0, blue: 212.0/255.0, alpha: 1.0)
示例代码见LLCollectionViewController.swift
如果使用过程中,有什么问题欢迎issues。
LvJianfeng, [email protected]