File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ typedef NS_ENUM(NSInteger, BEMAnimationType) {
9898 */
9999@property (strong , nonatomic ) IBInspectable UIColor *onFillColor;
100100
101+ /* * The color of the inside of the box when it is Off.
102+ */
103+ @property (strong , nonatomic ) IBInspectable UIColor *offFillColor;
104+
101105/* * The color of the check mark when it is On.
102106 */
103107@property (strong , nonatomic ) IBInspectable UIColor *onCheckColor;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ - (void)commonInit {
6868 _hideBox = NO ;
6969 _onTintColor = [UIColor colorWithRed: 0 green: 122.0 /255.0 blue: 255 /255 alpha: 1 ];
7070 _onFillColor = [UIColor clearColor ];
71+ _offFillColor = [UIColor clearColor ];
7172 _onCheckColor = [UIColor colorWithRed: 0 green: 122.0 /255.0 blue: 255 /255 alpha: 1 ];
7273 _tintColor = [UIColor lightGrayColor ];
7374 _lineWidth = 2.0 ;
@@ -185,6 +186,11 @@ - (void)setOnFillColor:(UIColor *)onFillColor {
185186 [self reload ];
186187}
187188
189+ - (void )setOffFillColor : (UIColor *)offFillColor {
190+ _offFillColor = offFillColor;
191+ [self reload ];
192+ }
193+
188194- (void )setOnCheckColor : (UIColor *)onCheckColor {
189195 _onCheckColor = onCheckColor;
190196 [self reload ];
@@ -255,10 +261,9 @@ - (void)drawOffBox {
255261 self.offBoxLayer = [CAShapeLayer layer ];
256262 self.offBoxLayer .frame = self.bounds ;
257263 self.offBoxLayer .path = [self .pathManager pathForBox ].CGPath ;
258- self.offBoxLayer .fillColor = [UIColor clearColor ] .CGColor ;
264+ self.offBoxLayer .fillColor = self. offFillColor .CGColor ;
259265 self.offBoxLayer .strokeColor = self.tintColor .CGColor ;
260266 self.offBoxLayer .lineWidth = self.lineWidth ;
261-
262267 self.offBoxLayer .rasterizationScale = 2.0 * [UIScreen mainScreen ].scale ;
263268 self.offBoxLayer .shouldRasterize = YES ;
264269
You can’t perform that action at this time.
0 commit comments