Skip to content

Commit

Permalink
Added show/hide methods for elements
Browse files Browse the repository at this point in the history
  • Loading branch information
azabujuban committed Jan 18, 2013
1 parent 607e9cc commit 444a1fa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ build/

xcuserdata
.idea/*

DerivedData/
3 changes: 3 additions & 0 deletions quickdialog/QuickDialogController.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@

+ (UINavigationController *)controllerWithNavigationForRoot:(QRootElement *)root;

- (void)hideElement:(QElement *)elem;
- (void)showElement:(QElement *)elem;


@end
17 changes: 17 additions & 0 deletions quickdialog/QuickDialogController.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,22 @@ - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

-(void)hideElement:(QElement *)elem
{
[elem setHidden:YES];
NSMutableArray * idx = [[NSMutableArray alloc] initWithObjects:[NSIndexPath indexPathForRow:elem.visibleIndex inSection:elem.parentSection.visibleIndex], nil];

[self.quickDialogTableView deleteRowsAtIndexPaths:idx withRowAnimation:UITableViewRowAnimationAutomatic];
}


-(void)showElement:(QElement *)elem
{
[elem setHidden:NO];
NSMutableArray * idx = [[NSMutableArray alloc] initWithObjects:[NSIndexPath indexPathForRow:elem.visibleIndex inSection:elem.parentSection.visibleIndex], nil];

[self.quickDialogTableView insertRowsAtIndexPaths:idx withRowAnimation:UITableViewRowAnimationAutomatic];
}


@end

0 comments on commit 444a1fa

Please sign in to comment.