mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
41 lines
870 B
Objective-C
41 lines
870 B
Objective-C
#import "TGModernCheckButtonViewModel.h"
|
|
|
|
#import "TGModernCheckButtonView.h"
|
|
|
|
@implementation TGModernCheckButtonViewModel
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
self.frame = frame;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (Class)viewClass
|
|
{
|
|
return [TGModernCheckButtonView class];
|
|
}
|
|
|
|
- (void)bindViewToContainer:(UIView *)container viewStorage:(TGModernViewStorage *)viewStorage
|
|
{
|
|
[super bindViewToContainer:container viewStorage:viewStorage];
|
|
|
|
[(TGModernCheckButtonView *)[self boundView] setChecked:_isChecked animated:false];
|
|
}
|
|
|
|
- (void)setIsChecked:(bool)isChecked
|
|
{
|
|
if (_isChecked != isChecked)
|
|
{
|
|
_isChecked = isChecked;
|
|
|
|
if ([self boundView] != nil)
|
|
[(TGModernCheckButtonView *)[self boundView] setChecked:_isChecked animated:true];
|
|
}
|
|
}
|
|
|
|
@end
|