-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGGSwitch.h
33 lines (20 loc) · 890 Bytes
/
GGSwitch.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
//
// GGSwitch.h
// GGSwitch
//
// Created by __无邪_ on 15/4/29.
// Copyright (c) 2015年 __无邪_. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GGSwitch : UIControl
@property (nonatomic, strong) UIColor *onTintColor;
@property (nonatomic, strong) UIColor *tintColor;
@property (nonatomic, strong) UIColor *thumbTintColor;
@property (nonatomic, strong) NSString *onText;
@property (nonatomic, strong) NSString *offText;
@property (nonatomic, unsafe_unretained) CGSize switchSize;// 设置大小, 建议宽高比2:1左右
@property (nonatomic, strong, setter=actionBlock:) void(^tapBlock)(BOOL on);
@property(nonatomic,getter=isOn) BOOL on;
- (instancetype)initWithFrame:(CGRect)frame; // This class enforces a size appropriate for the control. The frame size is ignored.
- (void)setOn:(BOOL)on animated:(BOOL)animated; // does not send action
@end