ZQTCustomSwitch.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // ZQTCustomSwitch.h
  3. // ZQTCustomSwitch
  4. //
  5. // Created by 赵群涛 on 16/5/25.
  6. // Copyright © 2016年 ZQT. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol ZQTCustomSwitchDelegate <NSObject>
  10. -(void)handleGestureRecognizerWithSwithOn:(BOOL)isOn;
  11. @end
  12. @interface ZQTCustomSwitch : UIControl<UIGestureRecognizerDelegate>
  13. @property (nonatomic, assign, getter = isOn) BOOL on;
  14. @property (nonatomic, strong) UIColor *onTintColor;
  15. @property (nonatomic, strong) UIColor *tintColor;
  16. @property (nonatomic, strong) UIColor *thumbTintColor;
  17. @property (nonatomic, assign) NSInteger switchKnobSize;
  18. @property (nonatomic, strong) UIColor *textColor;
  19. @property (nonatomic, strong) UIFont *textFont;
  20. @property (nonatomic, strong) NSString *onText;
  21. @property (nonatomic, strong) NSString *offText;
  22. @property (nonatomic,weak)id<ZQTCustomSwitchDelegate>delegate;
  23. - (void)setOn:(BOOL)on animated:(BOOL)animated;
  24. - (id)initWithFrame:(CGRect)frame onColor:(UIColor *)onColor offColor:(UIColor *)offColor font:(UIFont *)font ballSize:(NSInteger )ballSize;
  25. @end