iOS精选

AAPhotoBrowser 类似微信朋友圈效果的图片浏览器(s

2018-11-16  本文已影响29人  Fxxxxxxx

AAPhotoBrowser 类似微信朋友圈效果的图片浏览器

Nov-16-2018 14-47-54.gif
let browser = AAPhotoBrowser.init(with: self)
browser.selectedIndex = indexPath.item    //初始化显示图片的序号
UIApplication.shared.keyWindow?.rootViewController?.present(browser, animated: true, completion: nil)

代理方法:

//需要显示图片的数量
func numberOfPhotos(with browser: AAPhotoBrowser) -> Int
//序号对应显示的图片
func photo(of index: Int, with browser: AAPhotoBrowser) -> AAPhoto
    
//当前显示的图片序号
@objc optional func didDisplayPhoto(at index: Int, with browser: AAPhotoBrowser) -> Void
//长按序号为index的图片,可以自己在这里添加一些菜单操作
@objc optional func didLongPressPhoto(at index: Int, with browser: AAPhotoBrowser) -> Void

AAPhoto图片对象不设置originalView的话,将不会有显示和隐藏时坐标转换回到原位置的动画

欢迎集成和使用,联系方式:e2shao1993@163.com

上一篇下一篇

猜你喜欢

热点阅读