Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added toggle menu and dismiss keyboard when closing/opening #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions PaperFoldMenuController/PaperFoldMenuController.m
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,21 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
}

//Just all this action to open or close paperFold
- (void) toggleMenu {
NSInteger position = self.paperFoldView.contentView.frame.origin.x;
if(position == 0){
[self showMenu:YES animated:YES];
} else if( position >= self.menuWidth ){
[self showMenu:NO animated:YES];
}
}

- (void)showMenu:(BOOL)show animated:(BOOL)animated
{
//Force to hide keyboard
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];

if (show)
{
[self.paperFoldView setPaperFoldState:PaperFoldStateLeftUnfolded animated:animated];
Expand Down