Skip to content

Instantly share code, notes, and snippets.

@ipreencekmr
Created December 31, 2013 05:37
Show Gist options
  • Save ipreencekmr/8193047 to your computer and use it in GitHub Desktop.
Save ipreencekmr/8193047 to your computer and use it in GitHub Desktop.
//
// UITableView+TouchGesture.m
// HHH
//
// Created by Prince Kumar Sharma on 31/12/13.
// Copyright (c) 2013 Prince Kumar Sharma. All rights reserved.
//
#import "UITableView+TouchGesture.h"
@implementation UITableView (TouchGesture)
- (id<MyCustomDelegate>) customDelegate {
if ([[self delegate] conformsToProtocol:@protocol(MyCustomDelegate)]) {
return (id<MyCustomDelegate>)[self delegate];
}
return nil;
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([self.customDelegate respondsToSelector:@selector(tableView:touchBegan:withEvent:)]) {
[self.customDelegate tableView:self touchBegan:touches withEvent:event];
}
[super touchesBegan:touches withEvent:event];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([self.customDelegate respondsToSelector:@selector(tableView:touchEnded:withEvent:)]) {
[self.customDelegate tableView:self touchEnded:touches withEvent:event];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment