Latest 0.0.1
Homepage https://github.com/TardisCXX/TCCarouselView
License MIT
Platforms ios 8.0, requires ARC
Authors

TCCarouselView 是一个基于UICollectionView的简易无限轮播的功能组件,没有过于冗余的功能,十分轻量级。

TCCarouselView的使用

在需要用到的地方 #import <TCCarouselView.h>

在需要集成轮播视图的界面中创建UI:

// 创建只需要alloc init
TCCarouselView *carouselView = [[TCCarouselView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT / 3)];
self.carouselView = carouselView;
// 设置代理,目的是点击跳转
self.carouselView.delegate = self;
// 设置图片URL数组,可以是本地的路径,也可以网路URL
self.carouselView.imageUrls = array;
[self.view addSubview:self.carouselView];

实现代理方法

#pragma mark - TCCarouselViewDelegate

- (void)carouselView:(TCCarouselView *)carouselView didSelectedIndex:(NSInteger)index {
    // 此处做界面跳转操作
    TCDemoViewController *vc = [[TCDemoViewController alloc] init];
    switch (index) {
        case 0: {
            vc.color = [UIColor redColor];
            [self presentViewController:vc animated:YES completion:NULL];

            break;
        }
        case 2: {
            vc.color = [UIColor blueColor];
            [self presentViewController:vc animated:YES completion:NULL];

            break;
        }
        case 4: {
            vc.color = [UIColor blackColor];
            [self presentViewController:vc animated:YES completion:NULL];

            break;
        }
        case 6: {
            vc.color = [UIColor orangeColor];
            [self presentViewController:vc animated:YES completion:NULL];

            break;
        }

        default: {
            vc.color = [UIColor purpleColor];
            [self presentViewController:vc animated:YES completion:NULL];

            break;
        }
    }
}

安装

  1. CocoaPods安装:
    pod 'TCCarouselView' 
  2. 下载ZIP包,解压后将TCCarouselView资源文件拖到工程中。

其他

为了不影响您项目中导入的其他第三方库,本库没有依赖任何其他框架,可以放心使用。

  • 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的框架代码看看BUG修复没有)
  • 如果您有什么建议可以Issues我,谢谢
  • 后续我会持续更新,为它添加更多的功能,欢迎star :)

Latest podspec

{
    "name": "TCCarouselView",
    "version": "0.0.1",
    "summary": "u4e00u4e2au8f7bu91cfu7ea7u65e0u9650u8f6eu64adu7ec4u4ef6",
    "homepage": "https://github.com/TardisCXX/TCCarouselView",
    "license": "MIT",
    "authors": {
        "TardisCXX": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/TardisCXX/TCCarouselView.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "TCCarouselView",
        "TCCarouselViewProject/TCCarouselView/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This