Giter Club home page Giter Club logo

mmswiper's Introduction

MMSwiper

Pod Version Pod Platform Pod License

  • 基于UICollectionView的无限轮播图
  • 利用UICollectionView的原理减少性能消耗
  • 代码统计14kb,超小以及超轻级量
  • 调用简洁

基本属性

@property (nonatomic, weak) id<MMSwiperDelegate> delegate;
@property (nonatomic, assign) UIViewContentMode mm_contentMode; //设置图片的模式
@property (nonatomic, strong) NSMutableArray *models; //数组源
@property (nonatomic, strong) UIColor *pageIndicatorTintColor;  //page正常颜色
@property (nonatomic, strong) UIColor *currentPageIndicatorTintColor; //page滑动颜色
@property (nonatomic, assign) CGFloat pageBottomSpacing; // page距离底部的距离 默认10
@property (nonatomic, assign) BOOL isInfinite; // 是否启动无限循环  默认NO
@property (nonatomic, assign) BOOL isAuto; // 是否启动自动翻动  默认NO
@property (nonatomic, assign) NSTimeInterval timeInterval; //默认是3.0f
@property (nonatomic, assign) MMSwiperPageMode pageMode; //默认是MMSwiperPageModeBottomCenter
@property (nonatomic, strong) UIPageControl *pageControl; //自行设置
@property (nonatomic,copy) void (^didSelectItemAtIndexBlock)(id model,NSInteger index); //回调

如何使用

  MMSwiper* swiper= [[MMSwiper alloc]init];
  swiper.delegate = self;
  [self.view addSubview:swiper];
  swiper.models = ...//数据源数组;
  
  
//实现delegate
- (void)swiper:(MMSwiper *)swiper didSelectItemAtIndex:(NSInteger)index toModel:(MMSwiperModel *)model {
    NSLog(@"点击了-%ld",index);
}

- (void)swiper:(MMSwiper *)swiper forItemAtIndex:(NSInteger)index toModel:(MMSwiperModel *)model toCell:(MMSwiperCell *)cell {
    [cell.imageView sd_setImageWithURL:[NSURL URLWithString:model.url] placeholderImage:nil];
}


Installation with CocoaPods

pod "MMSwiper"

screenshots

mmswiper's People

Contributors

hzx157 avatar

Stargazers

 avatar  avatar

Watchers

James Cloos 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.