-
Notifications
You must be signed in to change notification settings - Fork 8
/
TAPageControl.h
executable file
·106 lines (70 loc) · 1.94 KB
/
TAPageControl.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
// TAPageControl.h
// TAPageControl
//
// Created by Tanguy Aladenise on 2015-01-21.
// Copyright (c) 2015 Tanguy Aladenise. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol TAPageControlDelegate;
@interface TAPageControl : UIControl
/**
* Dot view customization properties
*/
/**
* The Class of your custom UIView, make sure to respect the TAAbstractDotView class.
*/
@property (nonatomic) Class dotViewClass;
/**
* UIImage to represent a dot.
*/
@property (nonatomic) UIImage *dotImage;
/**
* UIImage to represent current page dot.
*/
@property (nonatomic) UIImage *currentDotImage;
/**
* Dot size for dot views. Default is 8 by 8.
*/
@property (nonatomic) CGSize dotSize;
@property (nonatomic, strong) UIColor *dotColor;
/**
* Spacing between two dot views. Default is 8.
*/
@property (nonatomic) NSInteger spacingBetweenDots;
/**
* Page control setup properties
*/
/**
* Delegate for TAPageControl
*/
@property(nonatomic,assign) id<TAPageControlDelegate> delegate;
/**
* Number of pages for control. Default is 0.
*/
@property (nonatomic) NSInteger numberOfPages;
/**
* Current page on which control is active. Default is 0.
*/
@property (nonatomic) NSInteger currentPage;
/**
* Hide the control if there is only one page. Default is NO.
*/
@property (nonatomic) BOOL hidesForSinglePage;
/**
* Let the control know if should grow bigger by keeping center, or just get longer (right side expanding). By default YES.
*/
@property (nonatomic) BOOL shouldResizeFromCenter;
/**
* Return the minimum size required to display control properly for the given page count.
*
* @param pageCount Number of dots that will require display
*
* @return The CGSize being the minimum size required.
*/
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount;
@end
@protocol TAPageControlDelegate <NSObject>
@optional
- (void)TAPageControl:(TAPageControl *)pageControl didSelectPageAtIndex:(NSInteger)index;
@end