- Fixed a spelling mistake on protocol name

This commit is contained in:
Aryan Gh 2013-04-29 17:50:07 -07:00
parent feb488680f
commit de6496c47e
5 changed files with 62 additions and 16 deletions

View File

@ -17,12 +17,12 @@
#pragma mark - SlideNavigationController Methods -
- (BOOL)slideNavigationControllerShouldSisplayLeftMenu
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu
{
return YES;
}
- (BOOL)slideNavigationControllerShouldSisplayRightMenu
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
{
return YES;
}

View File

@ -17,12 +17,12 @@
#pragma mark - SlideNavigationController Methods -
- (BOOL)slideNavigationControllerShouldSisplayLeftMenu
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu
{
return NO;
}
- (BOOL)slideNavigationControllerShouldSisplayRightMenu
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
{
return YES;
}

View File

@ -17,12 +17,12 @@
#pragma mark - SlideNavigationController Methods -
- (BOOL)slideNavigationControllerShouldSisplayLeftMenu
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu
{
return YES;
}
- (BOOL)slideNavigationControllerShouldSisplayRightMenu
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
{
return YES;
}

View File

@ -11,8 +11,8 @@
@protocol SlideNavigationControllerDelegate <NSObject>
@optional
- (BOOL)slideNavigationControllerShouldSisplayRightMenu;
- (BOOL)slideNavigationControllerShouldSisplayLeftMenu;
- (BOOL)slideNavigationControllerShouldDisplayRightMenu;
- (BOOL)slideNavigationControllerShouldDisplayLeftMenu;
@end
typedef enum{

View File

@ -100,8 +100,8 @@ static SlideNavigationController *singletonInstance;
self.view.frame = rect;
} completion:^(BOOL finished) {
[self popToRootViewControllerAnimated:NO];
[self pushViewController:viewController animated:NO];
[super popToRootViewControllerAnimated:NO];
[super pushViewController:viewController animated:NO];
[self closeMenuWithCompletion:^{
if (completion)
@ -111,14 +111,60 @@ static SlideNavigationController *singletonInstance;
}
else
{
[self popToRootViewControllerAnimated:NO];
[self pushViewController:viewController animated:YES];
[super popToRootViewControllerAnimated:NO];
[super pushViewController:viewController animated:YES];
if (completion)
completion();
}
}
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated
{
if ([self isMenuOpen])
{
[self closeMenuWithCompletion:^{
[super popToRootViewControllerAnimated:animated];
}];
}
else
{
return [super popToRootViewControllerAnimated:animated];
}
return nil;
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([self isMenuOpen])
{
[self closeMenuWithCompletion:^{
[super pushViewController:viewController animated:animated];
}];
}
else
{
[super pushViewController:viewController animated:animated];
}
}
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([self isMenuOpen])
{
[self closeMenuWithCompletion:^{
[super popToViewController:viewController animated:animated];
}];
}
else
{
return [super popToViewController:viewController animated:animated];
}
return nil;
}
#pragma mark - Private Methods -
- (UIBarButtonItem *)barButtonItemForMenu:(Menu)menu
@ -148,16 +194,16 @@ static SlideNavigationController *singletonInstance;
{
if (menu == MenuRight)
{
if ([vc respondsToSelector:@selector(slideNavigationControllerShouldSisplayRightMenu)] &&
[(UIViewController<SlideNavigationControllerDelegate> *)vc slideNavigationControllerShouldSisplayRightMenu])
if ([vc respondsToSelector:@selector(slideNavigationControllerShouldDisplayRightMenu)] &&
[(UIViewController<SlideNavigationControllerDelegate> *)vc slideNavigationControllerShouldDisplayRightMenu])
{
return YES;
}
}
if (menu == MenuLeft)
{
if ([vc respondsToSelector:@selector(slideNavigationControllerShouldSisplayLeftMenu)] &&
[(UIViewController<SlideNavigationControllerDelegate> *)vc slideNavigationControllerShouldSisplayLeftMenu])
if ([vc respondsToSelector:@selector(slideNavigationControllerShouldDisplayLeftMenu)] &&
[(UIViewController<SlideNavigationControllerDelegate> *)vc slideNavigationControllerShouldDisplayLeftMenu])
{
return YES;
}