1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGModernCheckButtonViewModel.m
2014-07-10 18:11:09 +04:00

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