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
|