Code Monkey home page Code Monkey logo

wyphotobrowser's Introduction

WYPhotoBrowser

图片浏览器

封装逻辑

  • WYPhotoBrowserViewController负责展示图片,每张图片是一个WYPhoto对象
  • WYPhotoBrowserTransition是展示和消失的动画的基类

安装

pod 'WYPhotoBrowser'

使用方法

  • Step1: 根据图片数组生成WYPhotoBrowserViewController对象
  • Step2: 指定数据源 dataSource
  • Step3: 调用 presentViewController:animated:completion:pushViewController:animated:弹出vc
  • Step4: 实现协议WYPhotoBrowserViewControllerDataSource
  NSInteger index = xxx;
  WYPhotoBrowserViewController *vc = [[WYPhotoBrowserViewController alloc] initWithPhotos:self.photos];
  vc.dataSource = self;
  vc.currentIndex = index;
  [self presentViewController:vc animated:YES completion:nil];
#pragma mark - WYPhotoBrowserViewControllerDataSource

- (CGRect)photoBrowserViewController:(WYPhotoBrowserViewController *)browserViewController sourceViewFrameAtScreenForIndex:(NSInteger)index {
  NSInteger tag = index + yyyyy;
  UIView *imgView = [self.view viewWithTag:xxxxx];
  return [self.view convertRect:imgView toView:[UIApplication sharedApplication].keyWindow];
}

如何扩展

您可以继承WYPhotoBrowserTransition继续给WYPhotoBrowserViewController添加动画效果

开始项目贡献

  • 如果您想对该项目有所贡献,可以fork我的项目,并将https://github.com/DouKing/WYPhotoBrowser.git添加到您的远程仓库
  • 如果您对该项目有任何疑问或建议,请给我留言,希望我们能携手打造出强大好用的图片浏览器

wyphotobrowser's People

Contributors

douking avatar

Stargazers

 avatar MohsinAli avatar

Watchers

James Cloos avatar MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.