Created
December 5, 2011 17:09
-
-
Save maxkramer/1434371 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
- (void) handlePan:(UIPanGestureRecognizer *) gesture { | |
if ((gesture.state == UIGestureRecognizerStateChanged) || | |
(gesture.state == UIGestureRecognizerStateEnded)) { | |
CGPoint location = [gesture locationInView:[self.tableView superview]]; | |
if (location.x <= (_tableView.frame.size.width / 2) + 40) { | |
if (location.x < _tableView.frame.size.width / 2-70 && isFilterViewShowing) | |
[self.tableView setFrame:CGRectMake(location.x, 0, _tableView.frame.size.width, _tableView.frame.size.height)]; | |
else if (location.x < _tableView.frame.size.width / 2 + 40) | |
[self.tableView setFrame:CGRectMake(location.x, 0, _tableView.frame.size.width, _tableView.frame.size.height)]; | |
if (location.x > 0) { | |
[self.navigationItem.leftBarButtonItem setAction:@selector(hideFilterMenu)]; | |
} | |
else if (location.x == 0) { | |
[self.navigationItem.leftBarButtonItem setAction:@selector(showFilterMenu)]; | |
} | |
} | |
isFilterViewShowing = location.x > 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment