-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
819 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ - (void)doAction { | |
self.timer = nil; | ||
return; | ||
} | ||
|
||
self.action(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
ZLSwipeableViewDemo/ZLSwipeableViewDemo/AllowedDirectionDemoViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
46 changes: 46 additions & 0 deletions
46
ZLSwipeableViewDemo/ZLSwipeableViewDemo/AllowedDirectionDemoViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
13 changes: 13 additions & 0 deletions
13
ZLSwipeableViewDemo/ZLSwipeableViewDemo/AlwaysSwipeDemoViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
29 changes: 29 additions & 0 deletions
29
ZLSwipeableViewDemo/ZLSwipeableViewDemo/AlwaysSwipeDemoViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.