Permalink
Browse files

- optional left-edge dragging.

when disabled (default), the menu can be revealed by dragging any part of the content view
when enabled - menu can only be revealed by dragging from the left edge of the screen. This can be useful if users still want to keep most part of the content view for other gestures.

- use a PaperFold branch that has optional left-edge dragging
  • Loading branch information...
1 parent a448d9e commit fa1a7d3c755fee4272f5157038c30acd4e6ee834 @honcheng committed Nov 23, 2012
@@ -26,6 +26,8 @@ - (id)initWithMenuWidth:(float)menuWidth numberOfFolds:(int)numberOfFolds
- (void)viewDidLoad {
[super viewDidLoad];
+ [self setOnlyAllowEdgeDrag:NO];
+
UIView *tableBgView = [[UIView alloc] initWithFrame:self.view.bounds];
[tableBgView setBackgroundColor:[UIColor colorWithRed:0.170 green:0.166 blue:0.175 alpha:1.000]];
[self.menuTableView setBackgroundView:tableBgView];
@@ -42,6 +42,7 @@
@property (nonatomic, weak) UITableView *menuTableView;
@property (nonatomic, weak) UIView *contentView;
@property (nonatomic, weak) id<PaperFoldMenuControllerDelegate> delegate;
+@property (nonatomic, assign) BOOL onlyAllowEdgeDrag;
/**
* Set and return the current view controller;
*/
@@ -323,6 +323,11 @@ - (void)showMenu:(BOOL)show animated:(BOOL)animated
}
}
+- (void)setOnlyAllowEdgeDrag:(BOOL)onlyAllowEdgeDrag
+{
+ [self.paperFoldView setEnableHorizontalEdgeDragging:onlyAllowEdgeDrag];
+}
+
#pragma mark - PaperFoldViewDelegate methods
- (void)paperFoldView:(id)thePaperFoldView didFoldAutomatically:(BOOL)theAutomated toState:(PaperFoldState)thePaperFoldState {

0 comments on commit fa1a7d3

Please sign in to comment.