基本信息
源码名称:自定义switch(ios)
源码大小:0.07M
文件格式:.zip
开发语言:C/C++
更新时间:2021-03-03
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 3 元 
   源码介绍

自定义开关,支持加载中


#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