Skip to content

Commit

Permalink
Merge pull request #4 from lxcid/master
Browse files Browse the repository at this point in the history
Tracks the paper fold state and updates accordingly + A bug fix to a bug I introduced.
  • Loading branch information
honcheng committed Nov 20, 2012
2 parents 0e25242 + bfc096f commit a448d9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PaperFoldMenuController/PaperFold
12 changes: 10 additions & 2 deletions PaperFoldMenuController/PaperFoldMenuController.m
Expand Up @@ -172,8 +172,8 @@ - (id)initWithMenuWidth:(float)menuWidth numberOfFolds:(int)numberOfFolds
return self; return self;
} }


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - (id)initWithNibName:(NSString *)theNibNameOrNil bundle:(NSBundle *)theNibBundleOrNil {
self = [super initWithNibName:nil bundle:nil]; self = [super initWithNibName:theNibNameOrNil bundle:theNibBundleOrNil];
if (self) if (self)
{ {
[self commonInit]; [self commonInit];
Expand Down Expand Up @@ -210,6 +210,7 @@ - (void)viewDidLoad
[self.paperFoldView setLeftFoldContentView:menuTableView foldCount:self.numberOfFolds pullFactor:0.9]; [self.paperFoldView setLeftFoldContentView:menuTableView foldCount:self.numberOfFolds pullFactor:0.9];
[menuTableView setDelegate:self]; [menuTableView setDelegate:self];
[menuTableView setDataSource:self]; [menuTableView setDataSource:self];
menuTableView.scrollsToTop = !(self.paperFoldView.state == PaperFoldStateDefault);
self.menuTableView = menuTableView; self.menuTableView = menuTableView;


ShadowView *menuTableViewSideShadowView = [[ShadowView alloc] initWithFrame:CGRectMake(_menuTableView.frame.size.width-3,0,3,[self.view bounds].size.height) foldDirection:FoldDirectionHorizontalLeftToRight]; ShadowView *menuTableViewSideShadowView = [[ShadowView alloc] initWithFrame:CGRectMake(_menuTableView.frame.size.width-3,0,3,[self.view bounds].size.height) foldDirection:FoldDirectionHorizontalLeftToRight];
Expand Down Expand Up @@ -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 @end

0 comments on commit a448d9e

Please sign in to comment.