AAPhotoBrowser 類似微信朋友圈效果的圖片瀏覽器
- 項目地址:AAPhotoBrowser
( Demo見項目地址) - 實現(xiàn)效果:縮放動畫,雙擊放大縮小附较,單擊隱藏,長按回調(diào)
Nov-16-2018 14-47-54.gif
-
集成方式:
- 項目原地址下載后馋贤,把AAPhotoBrowser文件夾拖入項目
- Cocoapods
pod 'AAPhotoBrowser'
使用方式:
顯示:
let browser = AAPhotoBrowser.init(with: self)
browser.selectedIndex = indexPath.item //初始化顯示圖片的序號
UIApplication.shared.keyWindow?.rootViewController?.present(browser, animated: true, completion: nil)
代理方法:
//需要顯示圖片的數(shù)量
func numberOfPhotos(with browser: AAPhotoBrowser) -> Int
//序號對應(yīng)顯示的圖片
func photo(of index: Int, with browser: AAPhotoBrowser) -> AAPhoto
//當(dāng)前顯示的圖片序號
@objc optional func didDisplayPhoto(at index: Int, with browser: AAPhotoBrowser) -> Void
//長按序號為index的圖片责球,可以自己在這里添加一些菜單操作
@objc optional func didLongPressPhoto(at index: Int, with browser: AAPhotoBrowser) -> Void
AAPhoto圖片對象不設(shè)置originalView
的話,將不會有顯示和隱藏時坐標(biāo)轉(zhuǎn)換回到原位置的動畫
歡迎集成和使用贸典,聯(lián)系方式:e2shao1993@163.com