1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGDialogListTitleContainer.m
2015-10-01 19:19:52 +03:00

32 lines
720 B
Objective-C

#import "TGDialogListTitleContainer.h"
@implementation TGDialogListTitleContainer
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self != nil)
{
[self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)]];
}
return self;
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)__unused event
{
if (CGRectContainsPoint(CGRectInset(self.bounds, -70.0f, -44.0f), point))
return self;
return nil;
}
- (void)tapGesture:(UITapGestureRecognizer *)recognizer
{
if (recognizer.state == UIGestureRecognizerStateEnded)
{
if (_tappped)
_tappped();
}
}
@end