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

Add new segue types for Toggle Rear and Toggle Right #348

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

#import "ColorViewController.h"

@interface ColorViewController ()
@property (nonatomic) IBOutlet UIBarButtonItem* revealButtonItem;
@end

@implementation ColorViewController

- (void)viewDidLoad
Expand All @@ -26,8 +22,6 @@ - (void)customSetup
SWRevealViewController *revealViewController = self.revealViewController;
if ( revealViewController )
{
[self.revealButtonItem setTarget: revealViewController];
[self.revealButtonItem setAction: @selector( revealToggle: )];
[self.navigationController.navigationBar addGestureRecognizer:revealViewController.panGestureRecognizer];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6185.7" systemVersion="13D65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="BnE-t1-cO2">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="BnE-t1-cO2">
<dependencies>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6181.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
<!--Reveal View Controller-->
Expand Down Expand Up @@ -114,7 +114,7 @@
</objects>
<point key="canvasLocation" x="695" y="-724"/>
</scene>
<!--iPad Color-->
<!--Color View Controller - iPad Color-->
<scene sceneID="a2e-Aa-0Nf">
<objects>
<viewController storyboardIdentifier="ColorViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ziO-d3-BPQ" customClass="ColorViewController" sceneMemberID="viewController">
Expand All @@ -132,12 +132,15 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="iPad Color" id="8uR-aH-2Ws">
<barButtonItem key="leftBarButtonItem" image="reveal-icon.png" style="plain" id="3Sl-96-8SJ"/>
<barButtonItem key="leftBarButtonItem" image="reveal-icon.png" style="plain" id="3Sl-96-8SJ">
<connections>
<segue destination="ziO-d3-BPQ" kind="custom" customClass="SWRevealViewControllerSegueRearToggle" id="rNM-f3-VCL"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<connections>
<outlet property="label" destination="o1O-Cu-zau" id="Wb9-OW-lD7"/>
<outlet property="revealButtonItem" destination="3Sl-96-8SJ" id="LGi-mA-mjD"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="GOw-3a-qgw" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand All @@ -159,7 +162,7 @@
</objects>
<point key="canvasLocation" x="1811" y="812"/>
</scene>
<!--iPad Map-->
<!--Map View Controller - iPad Map-->
<scene sceneID="hHE-Es-ToG">
<objects>
<viewController storyboardIdentifier="MapViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="dN4-6k-5wY" customClass="MapViewController" sceneMemberID="viewController">
Expand Down Expand Up @@ -208,13 +211,11 @@
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination">
<size key="portraitSize" width="768" height="1024"/>
<size key="landscapeSize" width="1024" height="768"/>
</simulatedScreenMetrics>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="Wxg-jn-KPh"/>
<segue reference="oNh-lZ-ivI"/>
<segue reference="Wxg-jn-KPh"/>
<segue reference="2od-hw-duN"/>
</inferredMetricsTieBreakers>
</document>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6185.7" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
<dependencies>
<deployment defaultVersion="1792" identifier="iOS"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6181.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
<!--Reveal View Controller-->
Expand Down Expand Up @@ -34,7 +34,7 @@
</objects>
<point key="canvasLocation" x="1400" y="736"/>
</scene>
<!--Map-->
<!--Map View Controller - Map-->
<scene sceneID="9dn-3g-hds">
<objects>
<viewController storyboardIdentifier="MapViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="IHS-Te-pvE" customClass="MapViewController" sceneMemberID="viewController">
Expand All @@ -54,7 +54,7 @@
</objects>
<point key="canvasLocation" x="1843" y="736"/>
</scene>
<!--Color-->
<!--Color View Controller - Color-->
<scene sceneID="vqL-qd-ja9">
<objects>
<viewController storyboardIdentifier="ColorViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="7k1-p9-rbO" customClass="ColorViewController" sceneMemberID="viewController">
Expand All @@ -69,17 +69,30 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="WpX-0N-dxT">
<rect key="frame" x="115" y="269" width="88" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Toggle Menu">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<segue destination="7k1-p9-rbO" kind="custom" customClass="SWRevealViewControllerSegueRearToggle" id="d36-UI-2J4"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="Color" id="KbI-f5-Z2j">
<barButtonItem key="leftBarButtonItem" image="reveal-icon.png" style="plain" id="Inx-Wl-XPE"/>
<barButtonItem key="leftBarButtonItem" image="reveal-icon.png" style="plain" id="Inx-Wl-XPE">
<connections>
<segue destination="7k1-p9-rbO" kind="custom" customClass="SWRevealViewControllerSegueRearToggle" id="c9D-1u-A5b"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="label" destination="ucw-mr-e6b" id="5nB-N3-R8R"/>
<outlet property="revealButtonItem" destination="Inx-Wl-XPE" id="2KA-Hv-hg1"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="G6n-3a-Zfu" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -198,13 +211,11 @@
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4">
<size key="portraitSize" width="320" height="568"/>
<size key="landscapeSize" width="568" height="320"/>
</simulatedScreenMetrics>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="OE9-CE-qWx"/>
<segue reference="MCT-x5-FOR"/>
<segue reference="iQA-45-dxz"/>
</inferredMetricsTieBreakers>
</document>
7 changes: 7 additions & 0 deletions SWRevealViewController/SWRevealViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,13 @@ extern NSString* const SWSegueRightIdentifier; // this is @"sw_right"
@interface SWRevealViewControllerSeguePushController : UIStoryboardSegue
@end

// Use this to toggle the menu
@interface SWRevealViewControllerSegueRearToggle : UIStoryboardSegue
@end

// Use this to toggle the right menu
@interface SWRevealViewControllerSegueRightToggle : UIStoryboardSegue
@end

//#pragma mark - SWRevealViewControllerSegue (DEPRECATED)
//
Expand Down
26 changes: 26 additions & 0 deletions SWRevealViewController/SWRevealViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,32 @@ - (void)perform
@end


#pragma mark - SWRevealViewControllerSegueRearToggle class

@implementation SWRevealViewControllerSegueRearToggle

- (void)perform
{
SWRevealViewController *rvc = [self.sourceViewController revealViewController];
[rvc revealToggleAnimated:YES];
}

@end

#pragma mark - SWRevealViewControllerSegueRightToggle class

@implementation SWRevealViewControllerSegueRightToggle

- (void)perform
{
SWRevealViewController *rvc = [self.sourceViewController revealViewController];
[rvc rightRevealToggleAnimated:YES];
}

@end



//#pragma mark - SWRevealViewControllerSegue Class
//
//@implementation SWRevealViewControllerSegue // DEPRECATED
Expand Down