自定义开关,支持加载中
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, HLESwitchState) { HLESwitchStateOff = 0, HLESwitchStateOn, HLESwitchStateLoading,};
typedef void(^vauleChangeBlock)(HLESwitchState);
NS_ASSUME_NONNULL_BEGIN
@interface HLESwitch : UIView
@property(nonatomic,assign)HLESwitchState state;//switch的状态
@property(nonatomic,assign)BOOL openLoading;//是否开启loading状态
@property(nullable, nonatomic, strong) UIColor *onTintColor API_AVAILABLE(ios(5.0)) UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong) UIColor *thumbTintColor API_AVAILABLE(ios(6.0)) UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong) UIImage *onImage API_AVAILABLE(ios(6.0)) UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, strong) UIImage *offImage API_AVAILABLE(ios(6.0)) UI_APPEARANCE_SELECTOR;
@property(nullable, nonatomic, copy) NSString *title API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos);
@property(nonatomic, readonly) UISwitchStyle style API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos);
@property(nonatomic) UISwitchStyle preferredStyle API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(tvos);
@property(nonatomic,strong)UIColor *activityIndicatorViewColor;
@property(nonatomic,copy)vauleChangeBlock block;
@end
NS_ASSUME_NONNULL_END
评论