1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-11 17:09:46 +01:00
Telegram/Telegraph/TGModernCheckButtonViewModel.m

41 lines
870 B
Mathematica
Raw Normal View History

2014-07-10 16:11:09 +02:00
#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