-
Notifications
You must be signed in to change notification settings - Fork 329
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
15 changed files
with
636 additions
and
55 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,2 +1,58 @@ | ||
ZLSwipeableView | ||
=============== | ||
A simple view for building card like interface like Tinder and Potluck. | ||
|
||
Preview | ||
--- | ||
###Swipe | ||
![swipe](Previews/swipe.gif) | ||
###Swipe Cancel | ||
![cancel](Previews/swipeCancel.gif) | ||
###Swipe Programmatically | ||
![swipeLeft](Previews/swipeLeft.gif) | ||
|
||
CocoaPods | ||
--- | ||
You can install `ZLSwipeableView` through CocoaPods adding the following to your Podfile: | ||
|
||
pod 'ZLSwipeableView' | ||
|
||
Usage | ||
--- | ||
Check out the demo app for an example. | ||
|
||
`ZLSwipeableView` can be added to storyboard or initialized programmatically: | ||
~~~objective-c | ||
ZLSwipeableView *swipeableView = [[ZLSwipeableView alloc] initWithFrame:self.view.frame]; | ||
[self.view addSubview:swipeableView]; | ||
~~~ | ||
A `ZLSwipeableView` **must** have an object that implements `ZLSwipeableViewDelegate` to act as a data source. `ZLSwipeableView` will prefetch **three** views in advance to animate them. | ||
~~~objective-c | ||
self.swipeableView.dataSource = self; | ||
- (UIView *)nextViewForSwipeableView:(ZLSwipeableView *)swipeableView { | ||
return [[UIView alloc] init]; | ||
} | ||
~~~ | ||
|
||
To swipe the top view programmatically: | ||
~~~objective-c | ||
[self.swipeableView swipeTopViewToLeft]; | ||
[self.swipeableView swipeTopViewToRight]; | ||
~~~ | ||
|
||
To discard all views and reload programmatically: | ||
~~~objective-c | ||
[self.swipeableView discardAllSwipeableViews]; | ||
[self.swipeableView loadNextSwipeableViewsIfNeeded]; | ||
~~~ | ||
|
||
Requirements | ||
--- | ||
- iOS 7 or higher. | ||
- Automatic Reference Counting (ARC). | ||
|
||
License | ||
--- | ||
ZLSwipeableView is available under MIT license. See the LICENSE file for more info. |
File renamed without changes.
File renamed without changes.
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
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/ZLSwipeableView/ZLPanGestureRecognizer.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 @@ | ||
// | ||
// ZLPanGestureRecognizer.h | ||
// ZLSwipeableViewDemo | ||
// | ||
// Created by Zhixuan Lai on 11/1/14. | ||
// Copyright (c) 2014 Zhixuan Lai. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface ZLPanGestureRecognizer : UIPanGestureRecognizer | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
ZLSwipeableViewDemo/ZLSwipeableViewDemo/ZLSwipeableView/ZLPanGestureRecognizer.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,13 @@ | ||
// | ||
// ZLPanGestureRecognizer.m | ||
// ZLSwipeableViewDemo | ||
// | ||
// Created by Zhixuan Lai on 11/1/14. | ||
// Copyright (c) 2014 Zhixuan Lai. All rights reserved. | ||
// | ||
|
||
#import "ZLPanGestureRecognizer.h" | ||
|
||
@implementation ZLPanGestureRecognizer | ||
|
||
@end |
Oops, something went wrong.