1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/Telegraph/TGInstantPreviewTouchAreaModel.m

55 lines
1.5 KiB
Mathematica
Raw Normal View History

2014-07-10 16:11:09 +02:00
/*
* This is the source code of Telegram for iOS v. 1.1
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Peter Iakovlev, 2013.
*/
#import "TGInstantPreviewTouchAreaModel.h"
#import "TGInstantPreviewTouchAreaView.h"
@implementation TGInstantPreviewTouchAreaModel
- (Class)viewClass
{
return [TGInstantPreviewTouchAreaView class];
}
- (void)bindViewToContainer:(UIView *)container viewStorage:(TGModernViewStorage *)viewStorage
{
[super bindViewToContainer:container viewStorage:viewStorage];
TGInstantPreviewTouchAreaView *view = (TGInstantPreviewTouchAreaView *)[self boundView];
view.touchesBeganAction = _touchesBeganAction;
view.touchesCompletedAction = _touchesCompletedAction;
}
- (void)unbindView:(TGModernViewStorage *)viewStorage
{
TGInstantPreviewTouchAreaView *view = (TGInstantPreviewTouchAreaView *)[self boundView];
view.touchesBeganAction = nil;
view.touchesCompletedAction = nil;
[super unbindView:viewStorage];
}
2015-10-01 18:19:52 +02:00
- (void)setTouchesBeganAction:(void (^)())touchesBeganAction
2014-07-10 16:11:09 +02:00
{
_touchesBeganAction = touchesBeganAction;
((TGInstantPreviewTouchAreaView *)[self boundView]).touchesBeganAction = touchesBeganAction;
}
2015-10-01 18:19:52 +02:00
- (void)setTouchesCompletedAction:(void (^)())touchesCompletedAction
2014-07-10 16:11:09 +02:00
{
_touchesCompletedAction = touchesCompletedAction;
((TGInstantPreviewTouchAreaView *)[self boundView]).touchesCompletedAction = touchesCompletedAction;
}
@end