AAPhotoBrowser 類似微信朋友圈效果的圖片瀏覽器
- 項(xiàng)目地址:AAPhotoBrowser
( Demo見項(xiàng)目地址) - 實(shí)現(xiàn)效果:縮放動(dòng)畫,雙擊放大縮小,單擊隱藏,長按回調(diào)

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