setupview added to initialiser method

This commit is contained in:
Murugan, Vimal 2019-05-03 20:03:48 +05:30
parent af3feae828
commit d2c489811b

View File

@ -183,6 +183,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
- (instancetype)initWithCoder:(NSCoder *)coder {
self = [super initWithCoder:coder];
if (self) {
[self setupView];
[self setupWithCheckedColor:[UIColor whiteColor] unCheckColor:[UIColor whiteColor] text:nil];
[self addAccessibleProperties];
}
@ -192,6 +193,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self setupView];
[self setupWithCheckedColor:[UIColor whiteColor] unCheckColor:[UIColor whiteColor] text:nil];
[self addAccessibleProperties];
}
@ -243,6 +245,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
[self.checkMark.centerXAnchor constraintEqualToAnchor:self.checkedSquare.centerXAnchor].active = YES;
[self.checkMark.centerYAnchor constraintEqualToAnchor:self.checkedSquare.centerYAnchor].active = YES;
} else {
[self.checkMark removeFromSuperview];
[self.checkedSquare addSubview:self.checkMark];
}