-
Notifications
You must be signed in to change notification settings - Fork 8
/
RLPageControl.h
34 lines (24 loc) · 1.01 KB
/
RLPageControl.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
//
// RLPageControl.h
// Siklus
//
// Created by Randy Luecke on 4/27/12.
// Copyright (c) 2012 Randy Luecke. All rights reserved.
//
#import <UIKit/UIKit.h>
// your draw block will take in a context, the index of the indicator, and a BOOL
// for whether or not it is highlighted.
typedef void(^RLDrawIndicatorBlock)(CGContextRef context, NSUInteger indicatorIndex, BOOL isHighlighted);
@interface RLPageControl : UIControl
// default is 0
@property(nonatomic) NSUInteger numberOfPages;
// default is 0. value pinned to 0..numberOfPages-1
@property(nonatomic) NSUInteger currentPage;
// hide the the indicator if there is only one page. default is NO
@property(nonatomic) BOOL hidesForSinglePage;
// returns minimum size required to display dots for given page count. can be used to size control if page count could change
- (CGSize)sizeForNumberOfPages:(NSUInteger)pageCount;
// Set the block of code that draws the indicator
// block defined above.
- (void)setIndicatorDrawBlock:(RLDrawIndicatorBlock)aBlock;
@end