Last active
August 29, 2015 14:06
-
-
Save frankus/9c98193ba8cf9dd4b4cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ExtendedCollectionView.h | |
// | |
// Created by Frank Schmitt on 7/11/14. | |
// | |
@interface ExtendedCollectionView : UICollectionView | |
@property (nonatomic) UIEdgeInsets touchAreaInsets; | |
@end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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