Skip to content

Commit

Permalink
fixing demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
zhxnlai committed Oct 26, 2015
1 parent dbc0856 commit 600c7fe
Show file tree
Hide file tree
Showing 23 changed files with 819 additions and 316 deletions.
37 changes: 0 additions & 37 deletions ZLSwipeableView/DefaultViewAnimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,4 @@

@interface DefaultViewAnimator : NSObject <ZLSwipeableViewAnimator>

// self.isRotationEnabled = YES;
// self.rotationDegree = 1;
// self.rotationRelativeYOffsetFromCenter = 0.3;
// self.programaticSwipeRotationRelativeYOffsetFromCenter = -0.2;

/*
/// Enable this to rotate the views behind the top view. Default to `YES`.
@property (nonatomic) BOOL isRotationEnabled;
/// Magnitude of the rotation in degrees
@property (nonatomic) float rotationDegree;
/// Relative vertical offset of the center of rotation. From 0 to 1. Default to
/// 0.3.
@property (nonatomic) float rotationRelativeYOffsetFromCenter;
/// Enable this to allow swiping left and right. Default to
/// `ZLSwipeableViewDirectionBoth`.
@property (nonatomic) ZLSwipeableViewDirection direction;
/// Magnitude in points per second.
@property (nonatomic) CGFloat escapeVelocityThreshold;
/// The relative distance from center that will
@property (nonatomic) CGFloat relativeTranslationThreshold;
/// Magnitude of velocity at which the swiped view will be animated.
@property (nonatomic) CGFloat pushVelocityMagnitude;
/// Swiped views will be destroyed when they collide with this rect.
@property (nonatomic) CGRect collisionRect;
/// Relative vertical offset of the center of rotation for swiping views
/// programatically.
@property (nonatomic) CGFloat programaticSwipeRotationRelativeYOffsetFromCenter;
*/

@end
45 changes: 0 additions & 45 deletions ZLSwipeableView/DefaultViewAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,50 +79,5 @@ - (void)animateView:(UIView *)view
break;
}
}
/*
- (void)animateSwipeableViewsIfNeeded {
UIView *topSwipeableView = self.topSwipeableView;
if (!topSwipeableView) {
return;
}

for (UIView *cover in self.containerView.subviews) {
cover.userInteractionEnabled = NO;
}
topSwipeableView.userInteractionEnabled = YES;
for (UIGestureRecognizer *recognizer in topSwipeableView.gestureRecognizers) {
if (recognizer.state != UIGestureRecognizerStatePossible) {
return;
}
}
if (self.isRotationEnabled) {
// rotation
NSUInteger numSwipeableViews = self.containerView.subviews.count;
if (numSwipeableViews >= 1) {
[self.animator removeBehavior:self.swipeableViewSnapBehavior];
self.swipeableViewSnapBehavior = [self
snapBehaviorThatSnapView:self.containerView.subviews[numSwipeableViews - 1]
toPoint:[self convertPoint:self.center fromView:self.superview]];
[self.animator addBehavior:self.swipeableViewSnapBehavior];
}
CGPoint rotationCenterOffset = {0, CGRectGetHeight(topSwipeableView.frame) *
self.rotationRelativeYOffsetFromCenter};
if (numSwipeableViews >= 2) {
[self rotateView:self.containerView.subviews[numSwipeableViews - 2]
forDegree:self.rotationDegree
atOffsetFromCenter:rotationCenterOffset
animated:YES];
}
if (numSwipeableViews >= 3) {
[self rotateView:self.containerView.subviews[numSwipeableViews - 3]
forDegree:-self.rotationDegree
atOffsetFromCenter:rotationCenterOffset
animated:YES];
}
}
}
*/
@end
1 change: 0 additions & 1 deletion ZLSwipeableView/Scheduler.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ - (void)doAction {
self.timer = nil;
return;
}

self.action();
}

Expand Down
16 changes: 7 additions & 9 deletions ZLSwipeableView/ZLSwipeableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ - (void)layoutSubviews {

#pragma mark - Properties

- (void)setDataSource:(id<ZLSwipeableViewDataSource>)dataSource {
_dataSource = dataSource;
[self loadViewsIfNeeded];
}

- (NSArray<UIView *> *)history {
return [_mutableHistory mutableCopy];
}
Expand Down Expand Up @@ -123,9 +118,12 @@ - (void)loadViewsIfNeeded {
}

- (void)rewind {
UIView *viewToBeRewinded = _mutableHistory.lastObject;
;
if (!viewToBeRewinded) {
UIView *viewToBeRewinded;

if (_mutableHistory.lastObject) {
viewToBeRewinded = _mutableHistory.lastObject;
[_mutableHistory removeLastObject];
} else {
viewToBeRewinded = [self previousView];
}

Expand Down Expand Up @@ -197,7 +195,7 @@ - (void)swipeTopViewFromPoint:(CGPoint)point inDirection:(CGVector)directionVect
return [[[[self allViews]
filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(UIView *view,
NSDictionary *bindings) {
return [activeViews containsObject:view];
return ![activeViews containsObject:view];
}]] reverseObjectEnumerator] allObjects];
}

Expand Down
48 changes: 42 additions & 6 deletions ZLSwipeableViewDemo/ZLSwipeableViewDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
0923646B1A59D90F009BC8B4 /* CardContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0923646A1A59D90F009BC8B4 /* CardContentView.xib */; };
092F0F341A05B474007CDDCC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F331A05B474007CDDCC /* main.m */; };
092F0F371A05B474007CDDCC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F361A05B474007CDDCC /* AppDelegate.m */; };
092F0F3A1A05B474007CDDCC /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F391A05B474007CDDCC /* ViewController.m */; };
092F0F3A1A05B474007CDDCC /* ZLSwipeableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F391A05B474007CDDCC /* ZLSwipeableViewController.m */; };
092F0F3D1A05B474007CDDCC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 092F0F3B1A05B474007CDDCC /* Main.storyboard */; };
092F0F3F1A05B474007CDDCC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 092F0F3E1A05B474007CDDCC /* Images.xcassets */; };
092F0F421A05B474007CDDCC /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 092F0F401A05B474007CDDCC /* LaunchScreen.xib */; };
092F0F4E1A05B474007CDDCC /* ZLSwipeableViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F4D1A05B474007CDDCC /* ZLSwipeableViewDemoTests.m */; };
092F0F661A05C9CA007CDDCC /* UIColor+FlatColors.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F651A05C9CA007CDDCC /* UIColor+FlatColors.m */; };
092F0F691A05DAF9007CDDCC /* CardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 092F0F681A05DAF8007CDDCC /* CardView.m */; };
093ED7281BDEC5580028D0BC /* CustomAnimationDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 093ED7271BDEC5580028D0BC /* CustomAnimationDemoViewController.m */; settings = {ASSET_TAGS = (); }; };
093ED72B1BDEC56E0028D0BC /* AllowedDirectionDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 093ED72A1BDEC56E0028D0BC /* AllowedDirectionDemoViewController.m */; settings = {ASSET_TAGS = (); }; };
093ED72E1BDEC58D0028D0BC /* HistoryDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 093ED72D1BDEC58D0028D0BC /* HistoryDemoViewController.m */; settings = {ASSET_TAGS = (); }; };
093ED7311BDEC64F0028D0BC /* PreviousViewDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 093ED7301BDEC64F0028D0BC /* PreviousViewDemoViewController.m */; settings = {ASSET_TAGS = (); }; };
093ED7341BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 093ED7331BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.m */; settings = {ASSET_TAGS = (); }; };
0971D4611A08425E00325B8D /* ZLSwipeableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0971D45F1A08425E00325B8D /* ZLSwipeableView.m */; };
099CF6441BDD35B000D05FAA /* ViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 099CF6431BDD35B000D05FAA /* ViewManager.m */; settings = {ASSET_TAGS = (); }; };
09A35C1F1BDDDA4900F39193 /* Scheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = 09A35C1E1BDDDA4900F39193 /* Scheduler.m */; settings = {ASSET_TAGS = (); }; };
Expand All @@ -27,6 +32,7 @@
09A35C2E1BDDE71F00F39193 /* DefaultShouldSwipeDeterminator.m in Sources */ = {isa = PBXBuildFile; fileRef = 09A35C2D1BDDE71F00F39193 /* DefaultShouldSwipeDeterminator.m */; settings = {ASSET_TAGS = (); }; };
09A35C311BDDE74500F39193 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 09A35C301BDDE74500F39193 /* Utils.m */; settings = {ASSET_TAGS = (); }; };
09C2FF811BDE953F00339692 /* ZLSwipeableViewSwipeOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 09C2FF801BDE953F00339692 /* ZLSwipeableViewSwipeOptions.m */; settings = {ASSET_TAGS = (); }; };
09C2FF841BDEAEA400339692 /* MenuTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 09C2FF831BDEAEA400339692 /* MenuTableViewController.m */; settings = {ASSET_TAGS = (); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -48,8 +54,8 @@
092F0F331A05B474007CDDCC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
092F0F351A05B474007CDDCC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
092F0F361A05B474007CDDCC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
092F0F381A05B474007CDDCC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
092F0F391A05B474007CDDCC /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
092F0F381A05B474007CDDCC /* ZLSwipeableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZLSwipeableViewController.h; sourceTree = "<group>"; };
092F0F391A05B474007CDDCC /* ZLSwipeableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZLSwipeableViewController.m; sourceTree = "<group>"; };
092F0F3C1A05B474007CDDCC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
092F0F3E1A05B474007CDDCC /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
092F0F411A05B474007CDDCC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
Expand All @@ -60,6 +66,16 @@
092F0F651A05C9CA007CDDCC /* UIColor+FlatColors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+FlatColors.m"; sourceTree = "<group>"; };
092F0F671A05DAF8007CDDCC /* CardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardView.h; sourceTree = "<group>"; };
092F0F681A05DAF8007CDDCC /* CardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardView.m; sourceTree = "<group>"; };
093ED7261BDEC5580028D0BC /* CustomAnimationDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomAnimationDemoViewController.h; sourceTree = "<group>"; };
093ED7271BDEC5580028D0BC /* CustomAnimationDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomAnimationDemoViewController.m; sourceTree = "<group>"; };
093ED7291BDEC56E0028D0BC /* AllowedDirectionDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllowedDirectionDemoViewController.h; sourceTree = "<group>"; };
093ED72A1BDEC56E0028D0BC /* AllowedDirectionDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AllowedDirectionDemoViewController.m; sourceTree = "<group>"; };
093ED72C1BDEC58D0028D0BC /* HistoryDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryDemoViewController.h; sourceTree = "<group>"; };
093ED72D1BDEC58D0028D0BC /* HistoryDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HistoryDemoViewController.m; sourceTree = "<group>"; };
093ED72F1BDEC64F0028D0BC /* PreviousViewDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviousViewDemoViewController.h; sourceTree = "<group>"; };
093ED7301BDEC64F0028D0BC /* PreviousViewDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PreviousViewDemoViewController.m; sourceTree = "<group>"; };
093ED7321BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlwaysSwipeDemoViewController.h; sourceTree = "<group>"; };
093ED7331BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlwaysSwipeDemoViewController.m; sourceTree = "<group>"; };
0971D45E1A08425E00325B8D /* ZLSwipeableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLSwipeableView.h; sourceTree = "<group>"; };
0971D45F1A08425E00325B8D /* ZLSwipeableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLSwipeableView.m; sourceTree = "<group>"; };
099CF6421BDD35B000D05FAA /* ViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewManager.h; sourceTree = "<group>"; };
Expand All @@ -78,6 +94,8 @@
09A35C301BDDE74500F39193 /* Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utils.m; sourceTree = "<group>"; };
09C2FF7F1BDE953F00339692 /* ZLSwipeableViewSwipeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZLSwipeableViewSwipeOptions.h; sourceTree = "<group>"; };
09C2FF801BDE953F00339692 /* ZLSwipeableViewSwipeOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZLSwipeableViewSwipeOptions.m; sourceTree = "<group>"; };
09C2FF821BDEAEA400339692 /* MenuTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTableViewController.h; sourceTree = "<group>"; };
09C2FF831BDEAEA400339692 /* MenuTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuTableViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -123,8 +141,20 @@
0971D45B1A08425E00325B8D /* ZLSwipeableView */,
092F0F351A05B474007CDDCC /* AppDelegate.h */,
092F0F361A05B474007CDDCC /* AppDelegate.m */,
092F0F381A05B474007CDDCC /* ViewController.h */,
092F0F391A05B474007CDDCC /* ViewController.m */,
09C2FF821BDEAEA400339692 /* MenuTableViewController.h */,
09C2FF831BDEAEA400339692 /* MenuTableViewController.m */,
092F0F381A05B474007CDDCC /* ZLSwipeableViewController.h */,
092F0F391A05B474007CDDCC /* ZLSwipeableViewController.m */,
093ED7261BDEC5580028D0BC /* CustomAnimationDemoViewController.h */,
093ED7271BDEC5580028D0BC /* CustomAnimationDemoViewController.m */,
093ED7291BDEC56E0028D0BC /* AllowedDirectionDemoViewController.h */,
093ED72A1BDEC56E0028D0BC /* AllowedDirectionDemoViewController.m */,
093ED72C1BDEC58D0028D0BC /* HistoryDemoViewController.h */,
093ED72D1BDEC58D0028D0BC /* HistoryDemoViewController.m */,
093ED72F1BDEC64F0028D0BC /* PreviousViewDemoViewController.h */,
093ED7301BDEC64F0028D0BC /* PreviousViewDemoViewController.m */,
093ED7321BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.h */,
093ED7331BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.m */,
092F0F671A05DAF8007CDDCC /* CardView.h */,
092F0F681A05DAF8007CDDCC /* CardView.m */,
0923646A1A59D90F009BC8B4 /* CardContentView.xib */,
Expand Down Expand Up @@ -308,21 +338,27 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
09C2FF841BDEAEA400339692 /* MenuTableViewController.m in Sources */,
09A35C251BDDDDF800F39193 /* ZLSwipeableViewMovement.m in Sources */,
092F0F3A1A05B474007CDDCC /* ViewController.m in Sources */,
093ED7311BDEC64F0028D0BC /* PreviousViewDemoViewController.m in Sources */,
092F0F3A1A05B474007CDDCC /* ZLSwipeableViewController.m in Sources */,
09A35C281BDDE6B300F39193 /* DefaultViewAnimator.m in Sources */,
092F0F661A05C9CA007CDDCC /* UIColor+FlatColors.m in Sources */,
09C2FF811BDE953F00339692 /* ZLSwipeableViewSwipeOptions.m in Sources */,
09A35C2B1BDDE70D00F39193 /* DefaultDirectionInterpretor.m in Sources */,
09A35C311BDDE74500F39193 /* Utils.m in Sources */,
092F0F371A05B474007CDDCC /* AppDelegate.m in Sources */,
0901414B1A37FF7900435455 /* PanGestureRecognizer.m in Sources */,
093ED7281BDEC5580028D0BC /* CustomAnimationDemoViewController.m in Sources */,
093ED72E1BDEC58D0028D0BC /* HistoryDemoViewController.m in Sources */,
09A35C2E1BDDE71F00F39193 /* DefaultShouldSwipeDeterminator.m in Sources */,
09A35C1F1BDDDA4900F39193 /* Scheduler.m in Sources */,
092F0F341A05B474007CDDCC /* main.m in Sources */,
092F0F691A05DAF9007CDDCC /* CardView.m in Sources */,
099CF6441BDD35B000D05FAA /* ViewManager.m in Sources */,
093ED72B1BDEC56E0028D0BC /* AllowedDirectionDemoViewController.m in Sources */,
0971D4611A08425E00325B8D /* ZLSwipeableView.m in Sources */,
093ED7341BDEC65F0028D0BC /* AlwaysSwipeDemoViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// CustomDirectionDemoViewController.h
// ZLSwipeableViewDemo
//
// Created by Zhixuan Lai on 10/26/15.
// Copyright © 2015 Zhixuan Lai. All rights reserved.
//

#import "ZLSwipeableViewController.h"

@interface AllowedDirectionDemoViewController : ZLSwipeableViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// CustomDirectionDemoViewController.m
// ZLSwipeableViewDemo
//
// Created by Zhixuan Lai on 10/26/15.
// Copyright © 2015 Zhixuan Lai. All rights reserved.
//

#import "AllowedDirectionDemoViewController.h"

@interface AllowedDirectionDemoViewController ()

@property (nonatomic, strong) NSArray<NSNumber *> *directions;
@end

@implementation AllowedDirectionDemoViewController

- (void)viewDidLoad {
[super viewDidLoad];

UISegmentedControl *segmentedControl = [[UISegmentedControl alloc]
initWithItems:@[ @" ", @"", @"", @"", @"", @"↔︎", @"↕︎", @"" ]];
[segmentedControl addTarget:self
action:@selector(segmentedControlAction:)
forControlEvents:UIControlEventValueChanged];
segmentedControl.selectedSegmentIndex = 7;
self.navigationItem.titleView = segmentedControl;

self.directions = @[
@(ZLSwipeableViewDirectionNone),
@(ZLSwipeableViewDirectionLeft),
@(ZLSwipeableViewDirectionUp),
@(ZLSwipeableViewDirectionRight),
@(ZLSwipeableViewDirectionDown),
@(ZLSwipeableViewDirectionHorizontal),
@(ZLSwipeableViewDirectionVertical),
@(ZLSwipeableViewDirectionAll)
];
}

- (void)segmentedControlAction:(UISegmentedControl *)control {
self.swipeableView.allowedDirection =
self.directions[control.selectedSegmentIndex].unsignedIntegerValue;
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// AlwaysSwipeDemoViewController.h
// ZLSwipeableViewDemo
//
// Created by Zhixuan Lai on 10/26/15.
// Copyright © 2015 Zhixuan Lai. All rights reserved.
//

#import "ZLSwipeableViewController.h"

@interface AlwaysSwipeDemoViewController : ZLSwipeableViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// AlwaysSwipeDemoViewController.m
// ZLSwipeableViewDemo
//
// Created by Zhixuan Lai on 10/26/15.
// Copyright © 2015 Zhixuan Lai. All rights reserved.
//

#import "AlwaysSwipeDemoViewController.h"

@interface AlwaysSwipeDemoViewController () <ZLSwipeableViewSwipingDeterminator>

@end

@implementation AlwaysSwipeDemoViewController

- (void)viewDidLoad {
[super viewDidLoad];

self.swipeableView.swipingDeterminator = self;
}

- (BOOL)shouldSwipeView:(UIView *)view
movement:(ZLSwipeableViewMovement *)movement
swipeableView:(ZLSwipeableView *)swipeableView {
return YES;
}

@end
Loading

0 comments on commit 600c7fe

Please sign in to comment.