Skip to content

Commit

Permalink
merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Lluch committed Aug 10, 2014
2 parents 2f108c1 + ce08628 commit 7019061
Show file tree
Hide file tree
Showing 9 changed files with 573 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,21 @@ - (void)applicationWillTerminate:(UIApplication *)application
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

#pragma mark state preservation / restoration

- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder
{
return YES;
}

- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder
{
return YES;
}

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//[self.window makeKeyAndVisible];
return YES;
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,57 @@ @implementation ColorViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self customSetup];
}


[self.revealButtonItem setTarget: self.revealViewController];
[self.revealButtonItem setAction: @selector( revealToggle: )];
[self.navigationController.navigationBar addGestureRecognizer: self.revealViewController.panGestureRecognizer];
- (void)customSetup
{
SWRevealViewController *revealViewController = self.revealViewController;
if ( revealViewController )
{
[self.revealButtonItem setTarget: revealViewController];
[self.revealButtonItem setAction: @selector( revealToggle: )];
[self.navigationController.navigationBar addGestureRecognizer:revealViewController.panGestureRecognizer];
}

_label.text = _text;
_label.textColor = _color;
}


#pragma mark state preservation / restoration

- (void)encodeRestorableStateWithCoder:(NSCoder *)coder
{
NSLog(@"%s", __PRETTY_FUNCTION__);

// Save what you need here
[coder encodeObject: _text forKey: @"text"];
[coder encodeObject: _color forKey: @"color"];

[super encodeRestorableStateWithCoder:coder];
}


- (void)decodeRestorableStateWithCoder:(NSCoder *)coder
{
NSLog(@"%s", __PRETTY_FUNCTION__);

// Restore what you need here
_color = [coder decodeObjectForKey: @"color"];
_text = [coder decodeObjectForKey: @"text"];

[super decodeRestorableStateWithCoder:coder];
}


- (void)applicationFinishedRestoringState
{
NSLog(@"%s", __PRETTY_FUNCTION__);

// Call whatever function you need to visually restore
[self customSetup];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,48 @@ @implementation MapViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self customSetup];
}

- (void)customSetup
{
SWRevealViewController *revealViewController = self.revealViewController;
if ( revealViewController )
{
[self.revealButtonItem setTarget: self.revealViewController];
[self.revealButtonItem setAction: @selector( revealToggle: )];
[self.navigationController.navigationBar addGestureRecognizer: self.revealViewController.panGestureRecognizer];
}
}

#pragma mark state preservation / restoration

- (void)encodeRestorableStateWithCoder:(NSCoder *)coder
{
NSLog(@"%s", __PRETTY_FUNCTION__);

// Save what you need here

[super encodeRestorableStateWithCoder:coder];
}


- (void)decodeRestorableStateWithCoder:(NSCoder *)coder
{
NSLog(@"%s", __PRETTY_FUNCTION__);

// Restore what you need here

[super decodeRestorableStateWithCoder:coder];
}


- (void)applicationFinishedRestoringState
{
NSLog(@"%s", __PRETTY_FUNCTION__);

[self.revealButtonItem setTarget: self.revealViewController];
[self.revealButtonItem setAction: @selector( revealToggle: )];
[self.navigationController.navigationBar addGestureRecognizer: self.revealViewController.panGestureRecognizer];
// Call whatever function you need to visually restore
[self customSetup];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,27 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}

#pragma mark state preservation / restoration
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder {
NSLog(@"%s", __PRETTY_FUNCTION__);

// TODO save what you need here

[super encodeRestorableStateWithCoder:coder];
}

- (void)decodeRestorableStateWithCoder:(NSCoder *)coder {
NSLog(@"%s", __PRETTY_FUNCTION__);

// TODO restore what you need here

[super decodeRestorableStateWithCoder:coder];
}

- (void)applicationFinishedRestoringState {
NSLog(@"%s", __PRETTY_FUNCTION__);

// TODO call whatever function you need to visually restore
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!--Reveal View Controller-->
<scene sceneID="kQx-iy-tfG">
<objects>
<viewController id="BnE-t1-cO2" customClass="SWRevealViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="SWRevealViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BnE-t1-cO2" customClass="SWRevealViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="AqQ-ZN-66p">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
Expand All @@ -26,8 +26,8 @@
<!--Menu View Controller-->
<scene sceneID="MRh-rO-dc1">
<objects>
<tableViewController id="QF7-9c-pUP" customClass="MenuViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="zp3-JK-cpb">
<tableViewController storyboardIdentifier="MenuViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="QF7-9c-pUP" customClass="MenuViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="MenuTableView" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="zp3-JK-cpb">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -117,7 +117,7 @@
<!--Color View Controller - iPad Color-->
<scene sceneID="a2e-Aa-0Nf">
<objects>
<viewController id="ziO-d3-BPQ" customClass="ColorViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="ColorViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ziO-d3-BPQ" customClass="ColorViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="pIg-cU-tR4">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
Expand Down Expand Up @@ -147,7 +147,7 @@
<!--Navigation Controller-->
<scene sceneID="9JS-IT-HOR">
<objects>
<navigationController definesPresentationContext="YES" id="nyM-DF-G37" sceneMemberID="viewController">
<navigationController storyboardIdentifier="NavigationControllerMap" definesPresentationContext="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="nyM-DF-G37" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="RQv-y7-19i">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
Expand All @@ -162,7 +162,7 @@
<!--Map View Controller - iPad Map-->
<scene sceneID="hHE-Es-ToG">
<objects>
<viewController id="dN4-6k-5wY" customClass="MapViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="MapViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="dN4-6k-5wY" customClass="MapViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ikb-if-QnY">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
Expand All @@ -189,8 +189,8 @@
<!--Navigation Controller-->
<scene sceneID="2Et-ek-LeJ">
<objects>
<navigationController definesPresentationContext="YES" id="rrL-rJ-NYi" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="cwG-Nk-Jya">
<navigationController storyboardIdentifier="NavigationControllerColor" definesPresentationContext="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="rrL-rJ-NYi" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" restorationIdentifier="NavigationBar" id="cwG-Nk-Jya">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
Expand All @@ -211,7 +211,7 @@
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="oNh-lZ-ivI"/>
<segue reference="Wxg-jn-KPh"/>
<segue reference="oNh-lZ-ivI"/>
</inferredMetricsTieBreakers>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!--Reveal View Controller-->
<scene sceneID="5">
<objects>
<viewController id="2" customClass="SWRevealViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="SWRevealViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="2" customClass="SWRevealViewController" sceneMemberID="viewController">
<connections>
<segue destination="vRn-8p-pLv" kind="custom" identifier="sw_rear" customClass="SWRevealViewControllerSegueSetController" id="tdg-ex-6WR"/>
<segue destination="fWZ-H6-3Jr" kind="custom" identifier="sw_front" customClass="SWRevealViewControllerSegueSetController" id="bla-Jd-Bu2"/>
Expand All @@ -21,7 +21,7 @@
<!--Navigation Controller-->
<scene sceneID="b5Y-SE-MeC">
<objects>
<navigationController definesPresentationContext="YES" id="fWZ-H6-3Jr" sceneMemberID="viewController">
<navigationController storyboardIdentifier="NavigationControllerMap" definesPresentationContext="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="fWZ-H6-3Jr" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Xkz-rr-sTC">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
Expand All @@ -36,7 +36,7 @@
<!--Map View Controller - Map-->
<scene sceneID="9dn-3g-hds">
<objects>
<viewController id="IHS-Te-pvE" customClass="MapViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="MapViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="IHS-Te-pvE" customClass="MapViewController" sceneMemberID="viewController">
<mapView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" id="E6O-iX-rep">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -56,7 +56,7 @@
<!--Color View Controller - Color-->
<scene sceneID="vqL-qd-ja9">
<objects>
<viewController id="7k1-p9-rbO" customClass="ColorViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="ColorViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="7k1-p9-rbO" customClass="ColorViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="aUE-BR-SVC"/>
<viewControllerLayoutGuide type="bottom" id="5RF-NJ-TaK"/>
Expand Down Expand Up @@ -90,7 +90,7 @@
<!--Menu View Controller-->
<scene sceneID="cdx-7p-qaC">
<objects>
<tableViewController id="vRn-8p-pLv" customClass="MenuViewController" sceneMemberID="viewController">
<tableViewController storyboardIdentifier="MenuViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="vRn-8p-pLv" customClass="MenuViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="DAb-w1-9EO">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down Expand Up @@ -180,7 +180,7 @@
<!--Navigation Controller-->
<scene sceneID="Ha0-6q-JcM">
<objects>
<navigationController definesPresentationContext="YES" id="vjx-U5-Non" sceneMemberID="viewController">
<navigationController storyboardIdentifier="NavigationControllerColor" definesPresentationContext="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="vjx-U5-Non" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Zt4-Qm-0EX">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
Expand Down
2 changes: 1 addition & 1 deletion SWRevealViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SWRevealViewController"
s.version = "2.1.0"
s.version = "2.2.0"
s.summary = "A UIViewController subclass for presenting two view controllers inspired in the Facebook app, done right."
s.homepage = "https://github.com/John-Lluch/SWRevealViewController"
s.license = "MIT"
Expand Down
Loading

0 comments on commit 7019061

Please sign in to comment.