Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
01FA7D39145B5FCC00D118DB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 01FA7D38145B5FCC00D118DB /* ViewController.m */; };
01FA7D3C145B5FCC00D118DB /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01FA7D3A145B5FCC00D118DB /* ViewController.xib */; };
01FACD21166114C800B8C1A0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 01FACD20166114C800B8C1A0 /* [email protected] */; };
AEFF7D8E19B10A4600859E49 /* ButtonFriendlyScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = AEFF7D8D19B10A4600859E49 /* ButtonFriendlyScrollView.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -38,6 +39,8 @@
01FA7D38145B5FCC00D118DB /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
01FA7D3B145B5FCC00D118DB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController.xib; sourceTree = "<group>"; };
01FACD20166114C800B8C1A0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
AEFF7D8C19B10A4600859E49 /* ButtonFriendlyScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonFriendlyScrollView.h; sourceTree = "<group>"; };
AEFF7D8D19B10A4600859E49 /* ButtonFriendlyScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ButtonFriendlyScrollView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -59,6 +62,8 @@
children = (
019466DA15B3129800B9CA30 /* SwipeView.h */,
019466DB15B3129800B9CA30 /* SwipeView.m */,
AEFF7D8C19B10A4600859E49 /* ButtonFriendlyScrollView.h */,
AEFF7D8D19B10A4600859E49 /* ButtonFriendlyScrollView.m */,
);
name = SwipeView;
path = ../../SwipeView;
Expand Down Expand Up @@ -183,6 +188,7 @@
buildActionMask = 2147483647;
files = (
01FA7D32145B5FCC00D118DB /* main.m in Sources */,
AEFF7D8E19B10A4600859E49 /* ButtonFriendlyScrollView.m in Sources */,
01FA7D36145B5FCC00D118DB /* AppDelegate.m in Sources */,
01FA7D39145B5FCC00D118DB /* ViewController.m in Sources */,
019466DC15B3129800B9CA30 /* SwipeView.m in Sources */,
Expand Down
13 changes: 13 additions & 0 deletions SwipeView/ButtonFriendlyScrollView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ButtonFriendlyScrollView.h
// SwipeViewExample
//
// Created by Piotr on 29/08/14.
//
//

#import <UIKit/UIKit.h>

@interface ButtonFriendlyScrollView : UIScrollView

@end
32 changes: 32 additions & 0 deletions SwipeView/ButtonFriendlyScrollView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// ButtonFriendlyScrollView.m
// SwipeViewExample
//
// Created by Piotr on 29/08/14.
//
//

#import "ButtonFriendlyScrollView.h"

@implementation ButtonFriendlyScrollView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/

- (BOOL)touchesShouldCancelInContentView:(UIView *)view
{
if ([view isKindOfClass:[UIButton class]])
{
return YES;
}

return [super touchesShouldCancelInContentView:view];
}


@end
4 changes: 2 additions & 2 deletions SwipeView/SwipeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#import "SwipeView.h"
#import <objc/message.h>

#import "ButtonFriendlyScrollView.h"

#pragma GCC diagnostic ignored "-Wdirect-ivar-access"
#pragma GCC diagnostic ignored "-Warc-repeated-use-of-weak"
Expand Down Expand Up @@ -103,7 +103,7 @@ - (void)setUp
_defersItemViewLoading = NO;
_vertical = NO;

_scrollView = [[UIScrollView alloc] init];
_scrollView = [[ButtonFriendlyScrollView alloc] init];
_scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
_scrollView.autoresizesSubviews = YES;
_scrollView.delegate = self;
Expand Down