- Fixed typo in delegate methods of SlideNavigationController ("slideNavigationControllerShouldSisplay" to "slideNavigationControllerShouldDisplay")

- Renamed SwitchViewController method to switchToViewController
- Fixed the bug where Navigation Items added in storyboard were being removed by the SlideMenu
This commit is contained in:
Aryan Gh 2013-05-11 23:06:27 -07:00
parent 53b7639bf2
commit 89d598fdbf
5 changed files with 19 additions and 14 deletions

View File

@ -62,7 +62,7 @@
break;
}
[[SlideNavigationController sharedInstance] switchViewController:vc withCompletion:nil];
[[SlideNavigationController sharedInstance] switchToViewController:vc withCompletion:nil];
}
@end

View File

@ -24,7 +24,7 @@
- (BOOL)slideNavigationControllerShouldDisplayRightMenu
{
return YES;
return NO;
}
@end

View File

@ -29,6 +29,6 @@ typedef enum{
@property (nonatomic, strong) UIBarButtonItem *rightBarButtonItem;
+ (SlideNavigationController *)sharedInstance;
- (void)switchViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;
- (void)switchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion;
@end

View File

@ -80,7 +80,7 @@ static SlideNavigationController *singletonInstance;
#pragma mark - Public Methods -
- (void)switchViewController:(UIViewController *)viewController withCompletion:(void (^)())completion
- (void)switchToViewController:(UIViewController *)viewController withCompletion:(void (^)())completion
{
if (self.avoidSwitchingToSameClassViewController && [self.topViewController isKindOfClass:viewController.class])
{
@ -207,8 +207,6 @@ static SlideNavigationController *singletonInstance;
{
return YES;
}
return NO;
}
return NO;
@ -279,13 +277,9 @@ static SlideNavigationController *singletonInstance;
{
if ([self shouldDisplayMenu:MenuLeft forViewController:viewController])
viewController.navigationItem.leftBarButtonItem = [self barButtonItemForMenu:MenuLeft];
else
viewController.navigationItem.leftBarButtonItem = nil;
if ([self shouldDisplayMenu:MenuRight forViewController:viewController])
viewController.navigationItem.rightBarButtonItem = [self barButtonItemForMenu:MenuRight];
else
viewController.navigationItem.rightBarButtonItem = nil;
}
#pragma mark - IBActions -

View File

@ -13,7 +13,7 @@
</navigationBar>
<connections>
<segue destination="mAB-md-uek" kind="relationship" relationship="rootViewController" id="z8d-Ml-dpq"/>
<segue destination="nrg-5w-bbF" kind="push" id="VVC-UO-FWZ"/>
<segue destination="nrg-5w-bbF" kind="push" identifier="ProfileSegue" id="VVC-UO-FWZ"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3Qg-wo-U2C" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -38,7 +38,7 @@
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<segue destination="Tha-f2-JWx" kind="push" id="jGs-V7-na4"/>
<segue destination="Tha-f2-JWx" kind="push" identifier="NoMenuSegue" id="jGs-V7-na4"/>
</connections>
</button>
</subviews>
@ -63,7 +63,18 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="No Menu" id="k71-Cl-mOP"/>
<navigationItem key="navigationItem" title="No Menu" id="k71-Cl-mOP">
<barButtonItem key="rightBarButtonItem" id="NgO-HE-8LY">
<segmentedControl key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" id="nE8-Dp-UZR">
<rect key="frame" x="220" y="6" width="95" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Seg 1"/>
<segment title="Seg 2"/>
</segments>
</segmentedControl>
</barButtonItem>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LfU-9k-SWv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
@ -87,7 +98,7 @@
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<segue destination="BLR-mt-TZ9" kind="push" id="yr9-GK-Pwl"/>
<segue destination="BLR-mt-TZ9" kind="push" identifier="RightMenuOnlySegue" id="yr9-GK-Pwl"/>
</connections>
</button>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="liN-HX-4nb">