.. | ||
TKCarouselView/TKCarouselView/Classes | ||
LICENSE | ||
README.md |
TKCarouselView
TKCarouselView is a roving graph tool that supports app styles such as jd and Tmall.
Demo Project
Installation
CocoaPods
- Add
pod 'TKCarouselView'
to your Podfile. - Run
pod install
orpod update
. - Import <TKCarouselView.h>.
Usage
NSArray *imageNames = @[@"image_name_1.png",@"image_name_2.png",@"image_name_3.png",@"image_name_4.png"];
TKCarouselView *carouselView = [[TKCarouselView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width/2)];
[self.view addSubview:carouselView];
[carouselView reloadImageCount:imageNames.count itemAtIndexBlock:^(UIImageView *imageView, NSInteger index) {
imageView.image = [UIImage imageNamed:imageNames[index]];
} imageClickedBlock:^(NSInteger index) {
NSLog(@"%@",@(index));
}];
License
TKCarouselView is released under the MIT license. See LICENSE for details.
中文介绍
TKCarouselView
TKCarouselView 是一款轮播图工具,支持京东、天猫等app样式.
项目演示
安装
CocoaPods
- 添加
pod 'TKCarouselView'
到你的 Podfile. - 跑
pod install
或者pod update
. - 包含头文件 Import <TKCarouselView.h>.
使用代码
NSArray *imageNames = @[@"image_name_1.png",@"image_name_2.png",@"image_name_3.png",@"image_name_4.png"];
TKCarouselView *carouselView = [[TKCarouselView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.width/2)];
[self.view addSubview:carouselView];
[carouselView reloadImageCount:imageNames.count itemAtIndexBlock:^(UIImageView *imageView, NSInteger index) {
imageView.image = [UIImage imageNamed:imageNames[index]];
} imageClickedBlock:^(NSInteger index) {
NSLog(@"%@",@(index));
}];
许可证
TKCarouselView is released under the MIT license. See LICENSE for details.