Permalink
Browse files

Tracks the paper fold state and turn the scrollsToTop accordingly so …

…that it does not compete with other scroll view when it is in default state.
  • Loading branch information...
1 parent 3fdbe70 commit bfc096f76bc5c288201d03643b8380258d8e75e0 @lxcid lxcid committed Nov 20, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −1 PaperFoldMenuController/PaperFold
  2. +8 −0 PaperFoldMenuController/PaperFoldMenuController.m
2 PaperFoldMenuController/PaperFold
@@ -1 +1 @@
-Subproject commit 0f9167e363f62c3af6ef4a923051f922ce7ef2f5
+Subproject commit 6ac4659fb7d6804ad4ada7197b474ecae533c633
View
8 PaperFoldMenuController/PaperFoldMenuController.m
@@ -210,6 +210,7 @@ - (void)viewDidLoad
[self.paperFoldView setLeftFoldContentView:menuTableView foldCount:self.numberOfFolds pullFactor:0.9];
[menuTableView setDelegate:self];
[menuTableView setDataSource:self];
+ menuTableView.scrollsToTop = !(self.paperFoldView.state == PaperFoldStateDefault);
self.menuTableView = menuTableView;
ShadowView *menuTableViewSideShadowView = [[ShadowView alloc] initWithFrame:CGRectMake(_menuTableView.frame.size.width-3,0,3,[self.view bounds].size.height) foldDirection:FoldDirectionHorizontalLeftToRight];
@@ -322,4 +323,11 @@ - (void)showMenu:(BOOL)show animated:(BOOL)animated
}
}
+#pragma mark - PaperFoldViewDelegate methods
+
+- (void)paperFoldView:(id)thePaperFoldView didFoldAutomatically:(BOOL)theAutomated toState:(PaperFoldState)thePaperFoldState {
+ BOOL thePaperFoldViewDidFold = (thePaperFoldState == PaperFoldStateDefault);
+ self.menuTableView.scrollsToTop = !thePaperFoldViewDidFold;
+}
+
@end

0 comments on commit bfc096f

Please sign in to comment.