Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Lluch committed Apr 2, 2013
1 parent 759eff9 commit 7c746bb
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 41 deletions.
39 changes: 33 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
/RevealControllerProject3.xcodeproj/xcuserdata/Nick.xcuserdatad/
/RevealControllerProject3.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/
/RevealControllerProject2.xcodeproj/xcuserdata/Nick.xcuserdatad/
/RevealControllerProject2.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/
/RevealControllerProject.xcodeproj/xcuserdata/Nick.xcuserdatad/
/RevealControllerProject.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject3.xcodeproj/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject3.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject2.xcodeproj/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject2.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject.xcodeproj/xcuserdata/Nick.xcuserdatad/
#/RevealControllerProject.xcodeproj/project.xcworkspace/xcuserdata/Nick.xcuserdatad/


martinhj.*
hhernandez.*
joan.*
*xcuserdata/*
*copy.*

# From https://github.com/github/gitignore/blob/master/Objective-C.gitignore
#
*.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: Joan Lluch (MV7322A4Y6)";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -351,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
PROVISIONING_PROFILE = "D37F0C7B-5F86-43A3-863A-8F78A80A6E61";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -367,7 +367,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: Joan Lluch (MV7322A4Y6)";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
Expand All @@ -377,6 +377,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PROVISIONING_PROFILE = "D37F0C7B-5F86-43A3-863A-8F78A80A6E61";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand All @@ -386,25 +387,21 @@
5E605BC714A081F900853025 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RevealControllerProject/Project-Prefix.pch";
INFOPLIST_FILE = "RevealControllerProject/RevealControllerProject-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
5E605BC814A081F900853025 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RevealControllerProject/Project-Prefix.pch";
INFOPLIST_FILE = "RevealControllerProject/RevealControllerProject-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
Binary file removed RevealControllerExample2/.DS_Store
Binary file not shown.
Binary file modified RevealControllerExample3/.DS_Store
Binary file not shown.
Binary file modified RevealControllerStoryboardExample/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2844" systemVersion="12C60" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="11E53" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1930"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
</dependencies>
<scenes>
<!--Reveal View Controller-->
Expand Down Expand Up @@ -186,7 +186,6 @@
<class className="ColorViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/ColorViewController.h"/>
<relationships>
<relationship kind="outlet" name="color" candidateClass="UIColor"/>
<relationship kind="outlet" name="label" candidateClass="UILabel"/>
<relationship kind="outlet" name="revealButtonItem" candidateClass="UIBarButtonItem"/>
</relationships>
Expand All @@ -213,7 +212,7 @@
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="Kfd-NS-DdZ"/>
<segue reference="xPp-Ho-rIG"/>
<segue reference="rf8-LM-xC2"/>
</inferredMetricsTieBreakers>
</document>
3 changes: 3 additions & 0 deletions SWRevealViewController/SWRevealViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ typedef enum

- (void)revealController:(SWRevealViewController *)revealController animateToPosition:(FrontViewPosition)position;

- (void)revealControllerPanGestureBegan:(SWRevealViewController *)revealController;
- (void)revealControllerPanGestureEnded:(SWRevealViewController *)revealController;

@end


Expand Down
48 changes: 24 additions & 24 deletions SWRevealViewController/SWRevealViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,17 @@ - (void)loadView
// load any defined front/rear controllers from the storyboard
if ( self.storyboard && _rearViewController == nil )
{
[self performSegueWithIdentifier:SWSegueRearIdentifier sender:nil];
[self performSegueWithIdentifier:SWSegueFrontIdentifier sender:nil];
}

// load any defined right controllers from the storyboard
if ( self.storyboard && _rightViewController == nil )
{
[self performSegueWithIdentifier:SWSegueRightIdentifier sender:nil];
@try
{
[self performSegueWithIdentifier:SWSegueRearIdentifier sender:nil];
[self performSegueWithIdentifier:SWSegueFrontIdentifier sender:nil];
[self performSegueWithIdentifier:SWSegueRightIdentifier sender:nil];
}
@catch(NSException *exception)
{
//NSLog(@"Caught %@: %@", [exception name], [exception reason]);
}
}


// Apple also tells us to do this:
_contentView.backgroundColor = [UIColor blackColor];
Expand Down Expand Up @@ -472,6 +473,11 @@ - (void)viewDidAppear:(BOOL)animated

// [_frontViewController view];
// [_rearViewController view];

// we store at this point the view's user interaction state as we may temporarily disable it
// and resume it back to the previous state, it is possible to override this behaviour by
// intercepting it on the panGestureBegan and panGestureEnded delegates
_userInteractionStore = _contentView.userInteractionEnabled;
}


Expand Down Expand Up @@ -604,9 +610,12 @@ - (void)rightRevealToggle:(id)sender
// disable userInteraction on the entire control
- (void)_disableUserInteraction
{
_userInteractionStore = _contentView.userInteractionEnabled;
//_userInteractionStore = _contentView.userInteractionEnabled;
[_contentView setUserInteractionEnabled:NO];
[_contentView setDisableLayout:YES];

if ( [_delegate respondsToSelector:@selector(revealControllerPanGestureBegan:)] )
[_delegate revealControllerPanGestureBegan:self];
}

// restore userInteraction on the control
Expand All @@ -616,6 +625,9 @@ - (void)_restoreUserInteraction
// to have our view interaction disabled beforehand
[_contentView setUserInteractionEnabled:_userInteractionStore];
[_contentView setDisableLayout:NO];

if ( [_delegate respondsToSelector:@selector(revealControllerPanGestureEnded:) ] )
[_delegate revealControllerPanGestureEnded:self];
}


Expand Down Expand Up @@ -894,6 +906,8 @@ - (void)_setFrontViewPosition:(FrontViewPosition)newPosition withDuration:(NSTim

void (^animations)() = ^()
{
// We call the layoutSubviews method on the contentView view and send a delegate, which will
// occur inside of an animation block if any animated transition is being performed
[_contentView layoutSubviews];

if ([_delegate respondsToSelector:@selector(revealController:animateToPosition:)])
Expand Down Expand Up @@ -965,20 +979,6 @@ - (void)_setRightViewController:(UIViewController*)newRightViewController
}


#pragma mark view controller deployment and layout

// Calls the layoutSubviews method on the contentView view and sends a delegate call, which will
// occur inside of an animation block if any animated transition is being performed
- (void)_layoutControllerViews
{
[_contentView layoutSubviews];

if ([_delegate respondsToSelector:@selector(revealController:animateToPosition:)])
[_delegate revealController:self animateToPosition:_frontViewPosition];

}


#pragma mark Position based view controller deployment

// Deploy/Undeploy of the front view controller following the containment principles. Returns a block
Expand Down

0 comments on commit 7c746bb

Please sign in to comment.