Skip to content

Commit

Permalink
added delegate method for when the sidebar changes state. helpful for…
Browse files Browse the repository at this point in the history
… updating views
  • Loading branch information
Robert Haining committed Dec 15, 2011
1 parent 591f5ec commit a17673e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions JTRevealSidebarV2/JTRevealSidebarV2Delegate.h
Expand Up @@ -13,5 +13,6 @@
@optional
- (UIView *)viewForLeftSidebar;
- (UIView *)viewForRightSidebar;
-(void)sidebarDidChangeState;

@end
8 changes: 8 additions & 0 deletions JTRevealSidebarV2/UIViewController+JTRevealSidebarV2.m
Expand Up @@ -123,6 +123,10 @@ - (void)revealLeftSidebar:(BOOL)showLeftSidebar {


[UIView commitAnimations];

if ( [delegate respondsToSelector:@selector(sidebarDidChangeState)]) {
[delegate sidebarDidChangeState];
}
}

- (void)revealRightSidebar:(BOOL)showRightSidebar {
Expand Down Expand Up @@ -153,6 +157,10 @@ - (void)revealRightSidebar:(BOOL)showRightSidebar {
NSLog(@"%@", NSStringFromCGAffineTransform(self.view.transform));

[UIView commitAnimations];

if ( [delegate respondsToSelector:@selector(sidebarDidChangeState)]) {
[delegate sidebarDidChangeState];
}
}

@end
Expand Down

0 comments on commit a17673e

Please sign in to comment.