• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

HYImageBrowser: image browser

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

HYImageBrowser

开源软件地址:

https://gitee.com/yan_1564335/HYImageBrowser

开源软件介绍:

HYImageBroswer

load images by kingfisher, support image, url, file path.

Install

pod 'HYImageBroswer'

Usage

find all UIImageView, order by addSubview function.

view.isAutoShowed = true  /// use isAutoShowed to show view's subviews which are UIImageView

Show images which you want.

override func viewDidLoad() {        super.viewDidLoad()        // Do any additional setup after loading the view.        view.backgroundColor = .white        // UIImageView set isRetrieval true, can be find        view.isOnlyRetrieval = true        view.isAutoShowed = true                for i in 0 ..< 4 {            let image1 = UIImageView.init(frame: CGRect.init(origin: CGPoint.init(x: 10, y: 100 * i + 20), size: CGSize.init(width: 200, height: 100)))            image1.contentMode = .scaleAspectFit            image1.clipsToBounds = true            // it sets isRetrieval true, can be find            image1.isRetrieval = true            image1.isUserInteractionEnabled = true            image1.kf.setImage(with: URL.init(string: "http://img.zcool.cn/community/0117e2571b8b246ac72538120dd8a4.jpg@1280w_1l_2o_100sh.jpg"))                        view.addSubview(image1)        }                let imageGoogle = UIImageView()        imageGoogle.image = UIImage.init(named: "google")        imageGoogle.frame = CGRect.init(x: 100, y: 100, width: 100, height: 100)        view.addSubview(imageGoogle)    }

Handle sources by yourself.

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {        let cell = tableView.cellForRow(at: indexPath)        let vc = HYPhotoTransitionViewController.init(preview: cell?.imageView?.image)        vc.index = indexPath.row        vc.previewDataSource = self        present(vc, animated: true, completion: nil)    }        func photoPreviewCount() -> Int {        return 50    }        func photoPreviewResource(at index: Int) -> Any? {        return "http://img.zcool.cn/community/0117e2571b8b246ac72538120dd8a4.jpg@1280w_1l_2o_100sh.jpg"    }        func photoPreviewTransitionFrame(with currentIndex: Int) -> CGRect {        let cell = tableView.cellForRow(at: IndexPath.init(row: currentIndex, section: 0))        return cell?.imageView?.rectInWindow ?? .zero    }

License

HYImageBroswer is available under the MIT license. See the LICENSE file for more info.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap