Skip to content

Commit

Permalink
Removed HorizontalSwipeRightInteractionController
Browse files Browse the repository at this point in the history
This logic has been folded into HorizontalSwipeInteractionController, where left / right behaviour is controlled via a boolean property.
  • Loading branch information
ColinEberhardt committed Nov 3, 2014
1 parent 78cf23f commit d1e3df0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
#import "CEBaseInteractionController.h"

/**
A horizontal swipe interaction controller. When used with a navigation controller, a right-to-left swipe
A horizontal swipe interaction controller. When used with a navigation controller, a right-to-left, or left-to-right swipe
will cause a 'pop' navigation. When used wth a tabbar controller, right-to-left and left-to-right cause navigation
between neighbouring tabs.
*/
@interface CEHorizontalSwipeInteractionController : CEBaseInteractionController

/**
Indicates whether a navigation controller 'pop' should occur on a right-to-left, or a left-to-right
swipe. This property does not affect tab controller or modal interactions.
*/
@property (nonatomic) BOOL popOnRightToLeft;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ -(void)dealloc {
}

- (void)wireToViewController:(UIViewController *)viewController forOperation:(CEInteractionOperation)operation{
self.popOnRightToLeft = YES;
_operation = operation;
_viewController = viewController;
[self prepareGestureRecognizerInView:viewController.view];
Expand Down Expand Up @@ -49,7 +50,8 @@ - (void)handleGesture:(UIPanGestureRecognizer*)gestureRecognizer {

if (_operation == CEInteractionOperationPop) {
// for pop operation, fire on right-to-left
if (rightToLeftSwipe) {
if ((self.popOnRightToLeft && rightToLeftSwipe) ||
(!self.popOnRightToLeft && !rightToLeftSwipe)) {
self.interactionInProgress = YES;
[_viewController.navigationController popViewControllerAnimated:YES];
}
Expand Down

This file was deleted.

118 changes: 0 additions & 118 deletions InteractionControllers/CEHorizontalSwipeRightInteractionController.m

This file was deleted.

6 changes: 0 additions & 6 deletions TransitionsDemo/TransitionsDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
72EE96D817EF47A60097DF82 /* CECardsAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EE96D717EF47A60097DF82 /* CECardsAnimationController.m */; };
72EE96DB17EF66040097DF82 /* CEVerticalSwipeInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 72EE96DA17EF66040097DF82 /* CEVerticalSwipeInteractionController.m */; };
7D0D046C1816DBA700F289A6 /* CENatGeoAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0D046B1816DBA700F289A6 /* CENatGeoAnimationController.m */; };
BC466838198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC466837198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.m */; };
BC46683B198B2E6700A07DF8 /* CEPanAnimationController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC46683A198B2E6700A07DF8 /* CEPanAnimationController.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -84,8 +83,6 @@
72EE96DA17EF66040097DF82 /* CEVerticalSwipeInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEVerticalSwipeInteractionController.m; sourceTree = "<group>"; };
7D0D046A1816DBA700F289A6 /* CENatGeoAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CENatGeoAnimationController.h; sourceTree = "<group>"; };
7D0D046B1816DBA700F289A6 /* CENatGeoAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CENatGeoAnimationController.m; sourceTree = "<group>"; };
BC466836198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEHorizontalSwipeRightInteractionController.h; sourceTree = "<group>"; };
BC466837198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEHorizontalSwipeRightInteractionController.m; sourceTree = "<group>"; };
BC466839198B2E6700A07DF8 /* CEPanAnimationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEPanAnimationController.h; sourceTree = "<group>"; };
BC46683A198B2E6700A07DF8 /* CEPanAnimationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CEPanAnimationController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -196,8 +193,6 @@
7273236417DFBF140072C7FD /* InteractionControllers */ = {
isa = PBXGroup;
children = (
BC466836198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.h */,
BC466837198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.m */,
7273236517DFBF140072C7FD /* CEBaseInteractionController.h */,
7273236617DFBF140072C7FD /* CEBaseInteractionController.m */,
7273236717DFBF140072C7FD /* CEHorizontalSwipeInteractionController.h */,
Expand Down Expand Up @@ -284,7 +279,6 @@
72C15E1117E10C620056B3F9 /* CECrossfadeAnimationController.m in Sources */,
72EC05A917E7B1BE00DCB9A3 /* CEPinchInteractionController.m in Sources */,
7273233017DFBD4D0072C7FD /* AppDelegate.m in Sources */,
BC466838198B2AC900A07DF8 /* CEHorizontalSwipeRightInteractionController.m in Sources */,
7273232C17DFBD4D0072C7FD /* main.m in Sources */,
7273236017DFBEBF0072C7FD /* CETurnAnimationController.m in Sources */,
7273236A17DFBF140072C7FD /* CEHorizontalSwipeInteractionController.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion TransitionsDemo/TransitionsDemo/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation SettingsViewController {
- (id)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
_animationControllers = @[@"None", @"Portal", @"Cards", @"Fold", @"Explode", @"Flip", @"Turn", @"Crossfade", @"NatGeo", @"Cube",@"Pan"];
_interactionControllers = @[@"None", @"HorizontalSwipe", @"HorizontalSwipeRight",@"VerticalSwipe", @"Pinch"];
_interactionControllers = @[@"None", @"HorizontalSwipe" ,@"VerticalSwipe", @"Pinch"];
}
return self;
}
Expand Down

0 comments on commit d1e3df0

Please sign in to comment.