JLChen
2021-08-02 38f4fb064df09f344fc3237409c76a9fba2a8a9e
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
//
//  DCRoundSwitch.h
//
//  Created by Patrick Richards on 28/06/11.
//  MIT License.
//
//  http://twitter.com/patr
//  http://domesticcat.com.au/projects
//  http://github.com/domesticcatsoftware/DCRoundSwitch
//
 
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
 
@class DCRoundSwitchToggleLayer;
@class DCRoundSwitchOutlineLayer;
@class DCRoundSwitchKnobLayer;
 
@interface DCRoundSwitch : UIControl
 
@property(nonatomic, strong) UIColor *onTintColor;        // default: blue (matches normal UISwitch)
@property (nonatomic, getter=isOn) BOOL on;                // default: NO
@property (nonatomic, copy) NSString *onText;            // default: 'ON' - automatically localized
@property (nonatomic, copy) NSString *offText;            // default: 'OFF' - automatically localized
 
+ (Class)knobLayerClass;
+ (Class)outlineLayerClass;
+ (Class)toggleLayerClass;
 
- (void)setOn:(BOOL)newOn animated:(BOOL)animated;
- (void)setOn:(BOOL)newOn animated:(BOOL)animated ignoreControlEvents:(BOOL)ignoreControlEvents;
 
@end