Latest 1.0.1
Homepage https://github.com/yulong000/YLLoopScrollView
License MIT
Platforms ios 8.0
Authors

无限轮播, 可以是图片, 可以是任意的自定义view


支持pod : pod ‘YLLoopScrollView’

使用教程:


1.导入头文件

#import "YLLoopScrollView.h"

2.调用类方法构造实例对象

// 传入轮播的时间(0 代表不启用定时器),需要轮播的自定义view,和需要重新赋值的model
YLLoopScrollView *scrollView = [YLLoopScrollView loopScrollViewWithTimer:2 customView:^NSDictionary *{
        return @{@"YLCustomView" : @"model"};
    }];

3.设置回调block

scrollView.clickedBlock = ^(NSInteger index) {
        NSLog(@"index : %d", index);
    };

4.设置数据源

// arr里存放的是自定义view的model
scrollView.dataSourceArr = arr;

5.设置frame

scrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, 150);

6.添加到父视图

[self.view addSubview:scrollView];

so easy ~~~ (具体使用方法请看demo)

最简单的应用

    NSArray *arr = @[[UIImage imageNamed:@"1.jpg"],
                     [UIImage imageNamed:@"2.jpg"],
                     [UIImage imageNamed:@"3.jpg"],
                     [UIImage imageNamed:@"4.jpg"]];
    YLLoopScrollView *scrollView = [YLLoopScrollView loopScrollViewWithTimer:2 customView:^NSDictionary *{
        return @{@"UIImageView" : @"image"};
    }];
    scrollView.dataSourceArr = arr;
    scrollView.clickedBlock = ^(NSInteger index) {
        // todo
    };
    scrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, 100);
    [self.view addSubview:scrollView];

Latest podspec

{
    "name": "YLLoopScrollView",
    "version": "1.0.1",
    "summary": "u8f6eu64ad",
    "description": "u8f6eu64ad,u53efu4ee5u5728u9879u76eeu91ccu591au51fau8c03u7528, u53eau9700u8981u81eau5b9au4e49u9700u8981u8f6eu64adu7684viewu5c31u53efu4ee5u4e86",
    "homepage": "https://github.com/yulong000/YLLoopScrollView",
    "license": "MIT",
    "authors": {
        "weiyulong": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/yulong000/YLLoopScrollView.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "YLLoopScrollView",
        "YLLoopScrollView/YLLoopScrollView/YLLoopScrollView/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This