Skip to content

Instantly share code, notes, and snippets.

@frankus
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankus/9c98193ba8cf9dd4b4cd to your computer and use it in GitHub Desktop.
Save frankus/9c98193ba8cf9dd4b4cd to your computer and use it in GitHub Desktop.
//
// ExtendedCollectionView.h
//
// Created by Frank Schmitt on 7/11/14.
//
@interface ExtendedCollectionView : UICollectionView
@property (nonatomic) UIEdgeInsets touchAreaInsets;
@end
//
// ExtendedCollectionView.m
//
// Created by Frank Schmitt on 7/11/14.
//
#import "ExtendedCollectionView.h"
@implementation ExtendedCollectionView
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
CGRect extendedBounds = UIEdgeInsetsInsetRect(self.bounds, self.touchAreaInsets);
return CGRectContainsPoint(extendedBounds, point);
}
- (CGRect)_visibleBounds {
return UIEdgeInsetsInsetRect(self.bounds, self.touchAreaInsets);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment