Skip to content

Commit

Permalink
Add a tap gesture recognizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
André Schneider committed Jun 29, 2014
1 parent f0ec98b commit 0121784
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Popping/FoldView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ typedef NS_ENUM(NSInteger, LayerSection) {
@interface FoldView()
- (void)addTopView;
- (void)addBottomView;
- (void)addGestureRecognizer;
- (void)addGestureRecognizers;
- (void)rotateToOrigin;
- (void)poke;
- (void)handlePan:(UIPanGestureRecognizer *)recognizer;
- (CATransform3D)transform3D;
- (UIImage *)imageForSection:(LayerSection)section withImage:(UIImage *)image;
Expand All @@ -40,7 +41,7 @@ - (id)initWithFrame:(CGRect)frame image:(UIImage *)image
[self addBottomView];
[self addTopView];

[self addGestureRecognizer];
[self addGestureRecognizers];
}
return self;
}
Expand Down Expand Up @@ -79,11 +80,20 @@ - (void)addBottomView
[self addSubview:bottomView];
}

- (void)addGestureRecognizer
- (void)addGestureRecognizers
{
UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self
action:@selector(handlePan:)];

UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(poke)];

[self.topView addGestureRecognizer:panGestureRecognizer];
[self.topView addGestureRecognizer:tapGestureRecognizer];
}

- (void)poke {
NSLog(@"Poke!");
}

- (void)handlePan:(UIPanGestureRecognizer *)recognizer
Expand Down

0 comments on commit 0121784

Please sign in to comment.