-
Notifications
You must be signed in to change notification settings - Fork 2
/
FTScrollableClockView.h
78 lines (51 loc) · 2.01 KB
/
FTScrollableClockView.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
//
// FTScrollableClockView.h
// FTLibrary
//
// Created by Ondrej Rafaj on 02/11/2011.
// Copyright (c) 2011 Fuerte International. All rights reserved.
//
/**
Example usage
FTScrollableClockView *cv = [[FTScrollableClockView alloc] initWithFrame:CGRectMake(100, 100, 120, 44) andTimeFormat:FTScrollableClockViewTimeFormat12H];
[cv setDelegate:self];
[cv setBackgroundColor:[UIColor redColor]];
[self.view addSubview:cv];
*/
#import <UIKit/UIKit.h>
typedef enum {
FTScrollableClockViewTimeFormat24H,
FTScrollableClockViewTimeFormat12H
} FTScrollableClockViewTimeFormat;
@interface FTScrollableClockViewTime : NSObject {
NSInteger hours;
NSInteger minutes;
}
@property (nonatomic) NSInteger hours;
@property (nonatomic) NSInteger minutes;
@end;
@class FTScrollableClockView;
@protocol FTScrollableClockViewDelegate <NSObject>
- (void)scrollableClockView:(FTScrollableClockView *)view didChangeTime:(FTScrollableClockViewTime *)time;
@end
@interface FTScrollableClockView : UIView <UIScrollViewDelegate> {
UIScrollView *hours;
UIScrollView *minutes;
FTScrollableClockViewTimeFormat timeFormat;
FTScrollableClockViewTime *_currentTime;
NSMutableArray *hourLabels;
NSMutableArray *minuteLabels;
id <FTScrollableClockViewDelegate> delegate;
}
@property (nonatomic, retain) UIScrollView *hours;
@property (nonatomic, retain) UIScrollView *minutes;
@property (nonatomic, readonly) FTScrollableClockViewTimeFormat timeFormat;
@property (nonatomic, retain) FTScrollableClockViewTime *currentTime;
@property (nonatomic, assign) id <FTScrollableClockViewDelegate> delegate;
- (id)initWithFrame:(CGRect)frame currentTime:(FTScrollableClockViewTime *)time andTimeFormat:(FTScrollableClockViewTimeFormat)format;
- (id)initWithFrame:(CGRect)frame andTimeFormat:(FTScrollableClockViewTimeFormat)format;
- (void)setCurrentTime:(FTScrollableClockViewTime *)currentTime animated:(BOOL)animated;
- (void)setFont:(UIFont *)font;
- (void)setTextColor:(UIColor *)color;
- (void)setTextAlignment:(UITextAlignment)alignment;
@end