CycleView_OC 1.0.6

CycleView_OC 1.0.6

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年11月

Sariel Tang 维护。



  • SarielTang
  • 使用无限循环视图的最简单方式
  • 用法最简单的无限循环图片轮播器,使用 OC 实现,使用起来更加方便。

要求

  • iOS 5.0+

安装

如何使用 CycleView

  • cocoapods 导入:pod 'CycleView_OC'
  • 手动导入:
    • CycleView_OC/Classes 文件夹中的所有文件拖入项目中
    • 导入主头文件:#import "CycleView_OC.h"

用法

#import "CycleViewController.h"
//此处的协议用于监听图片被点击的事件。
@interface CycleViewController ()<PictureCycleCellDelegate>

@end

@implementation CycleViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    NSMutableArray *arrayM = [NSMutableArray array];

    for (int i = 0; i < 5; ++i) {

        NSString *imageName = [NSString stringWithFormat:@"%02d.jpg", i + 1];
        [arrayM addObject:[UIImage imageNamed:imageName]];
    }
    //传入图片列表
    self.cycleImageList = arrayM;
}

///通过重写这个代理方法,即可进行点击图片后的交互处理.
//itemTag为图片的tag值,默认从0开始递增。
- (void)pictureCycleCellDidSelected:(NSInteger)itemTag{
    NSLog(@"被选中的item的tag值:%zd", itemTag);
}