-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathAutoSlideScrollView.h
executable file
·48 lines (38 loc) · 1.19 KB
/
AutoSlideScrollView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// AutoSlideScrollView.h
// AutoSlideScrollViewDemo
//
// Created by Mike Chen on 14-1-23.
// Copyright (c) 2014年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AutoSlideScrollView : UIView
@property (nonatomic , readonly) UIScrollView *scrollView;
@property (nonatomic , assign, readonly) NSInteger currentPageIndex;
/**
* 初始化
*
* @param frame frame
* @param animationDuration 自动滚动的间隔时长。如果<=0,不自动滚动。
*
* @return instance
*/
- (id)initWithFrame:(CGRect)frame animationDuration:(NSTimeInterval)animationDuration;
- (void)reloadData;
/**
数据源:获取总的page个数,如果少于2个,不自动滚动
**/
@property (nonatomic , copy) NSInteger (^totalPagesCount)();
/**
数据源:获取第pageIndex个位置的contentView
**/
@property (nonatomic , copy) UIView *(^fetchContentViewAtIndex)(NSInteger pageIndex);
/**
当点击的时候,执行的block
**/
@property (nonatomic , copy) void (^tapActionBlock)(NSInteger pageIndex);
/**
当currentPageIndex改变的时候,执行的block
**/
@property (nonatomic , copy) void (^currentPageIndexChangeBlock)(NSInteger currentPageIndex);
@end