mirror of
https://github.com/danog/Telegram.git
synced 2024-12-11 17:09:46 +01:00
41 lines
870 B
Mathematica
41 lines
870 B
Mathematica
|
#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
|