CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2016 |
Maintained by Andy.
Use the CocoaPods.
In your Podfile
pod 'SCLoopScrollView'
Get SCNumberKeyBoard
#import "SCLoopScrollView.h"
Drag SCLoopScrollViewDemo/Classes
folder into your project
#import "SCLoopScrollView.h"
NSArray *images = @[@"http://i8.tietuku.com/a6542887e864efc0.jpg",
[UIImage imageNamed:@"3"],
@"http://i8.tietuku.com/5730f7ebadae2c41.jpg",
[UIImage imageNamed:@"4"],
@"http://i8.tietuku.com/149caebe062fc98c.jpg"];
SCLoopScrollView *scrollView = [[SCLoopScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.frame.size.width, self.view.frame.size.width*0.75)];
scrollView.backgroundColor = [UIColor lightGrayColor];
[self.view addSubview:scrollView];
scrollView.dataSource = images;
[scrollView show:^(NSInteger index) {
NSLog(@"Tap Index:%@", @(index));
} scrolled:^(NSInteger index) {
NSLog(@"Current Index:%@", @(index));
}];
NSArray *images = @[@"http://i8.tietuku.com/a6542887e864efc0.jpg",
[UIImage imageNamed:@"3"],
@"http://i8.tietuku.com/5730f7ebadae2c41.jpg",
[UIImage imageNamed:@"4"],
@"http://i8.tietuku.com/149caebe062fc98c.jpg"];
_scrollView.dataSource = images;
__weak __typeof__(self)weakSelf = self;
[_scrollView show:^(NSInteger index) {
__strong __typeof__(self)strongSelf = weakSelf;
strongSelf.tapLabel.text = @(index).stringValue;
} scrolled:^(NSInteger index) {
__strong __typeof__(self)strongSelf = weakSelf;
strongSelf.indexLabel.text = @(index).stringValue;
}];
pod 'SCLoopScrollView'
SCLoopScrollViewDemo/Classes
文件夹中的所有文件拽入项目中#import "SCLoopScrollView.h"
NSArray *images = @[@"http://i8.tietuku.com/a6542887e864efc0.jpg",
[UIImage imageNamed:@"3"],
@"http://i8.tietuku.com/5730f7ebadae2c41.jpg",
[UIImage imageNamed:@"4"],
@"http://i8.tietuku.com/149caebe062fc98c.jpg"];
SCLoopScrollView *scrollView = [[SCLoopScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.frame.size.width, self.view.frame.size.width*0.75)];
scrollView.backgroundColor = [UIColor lightGrayColor];
[self.view addSubview:scrollView];
scrollView.dataSource = images;
[scrollView show:^(NSInteger index) {
NSLog(@"Tap Index:%@", @(index));
} scrolled:^(NSInteger index) {
NSLog(@"Current Index:%@", @(index));
}];
NSArray *images = @[@"http://i8.tietuku.com/a6542887e864efc0.jpg",
[UIImage imageNamed:@"3"],
@"http://i8.tietuku.com/5730f7ebadae2c41.jpg",
[UIImage imageNamed:@"4"],
@"http://i8.tietuku.com/149caebe062fc98c.jpg"];
_scrollView.dataSource = images;
__weak __typeof__(self)weakSelf = self;
[_scrollView show:^(NSInteger index) {
__strong __typeof__(self)strongSelf = weakSelf;
strongSelf.tapLabel.text = @(index).stringValue;
} scrolled:^(NSInteger index) {
__strong __typeof__(self)strongSelf = weakSelf;
strongSelf.indexLabel.text = @(index).stringValue;
}];