Skip to content

Commit

Permalink
Follow Y Direction Only
Browse files Browse the repository at this point in the history
  • Loading branch information
groundwater committed Jul 3, 2012
1 parent 993e688 commit b6086be
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Card Snap/MainView.m
Expand Up @@ -21,10 +21,15 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
CGFloat width = self.view.bounds.size.width;
CGFloat center = width/2.0;

for(UITouch *touch in touches)
{
CGPoint touchPoint = [touch locationInView:[self view]];
[cardView setCenter:touchPoint];
CGPoint touchPoint = [touch locationInView:[self view]];
CGPoint targetPoint = CGPointMake(center, touchPoint.y);

[cardView setCenter:targetPoint];
}
}

Expand Down

0 comments on commit b6086be

Please sign in to comment.