-
Notifications
You must be signed in to change notification settings - Fork 27
Rename flick to swipe #26
base: master
Are you sure you want to change the base?
Conversation
I see them as different gestures.
|
@visiongeist can you give any link to implementation/example of flick & swipe?
I think this is a 'track' event. |
I think the flick implementation is fine in the original PointerGestures however the swipe can be observed for instance on iOS7 when you open the mail app and swipe on a mail to open the menu with the trash button |
The source of GestureRecognizer from //
// UISwipeGestureRecognizer.h
// UIKit
//
// Copyright (c) 2009-2013, Apple Inc. All rights reserved.
//
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIGestureRecognizer.h>
// Recognizes: when numberOfTouchesRequired have moved mostly in the specified direction, enough to be considered a swipe.
// a slow swipe requires high directional precision but a small distance
// a fast swipe requires low directional precision but a large distance
// Touch Location Behaviors:
// locationInView: location where the swipe began. this is the centroid if more than one touch was involved
// locationOfTouch:inView: location of a particular touch when the swipe began
typedef NS_OPTIONS(NSUInteger, UISwipeGestureRecognizerDirection) {
UISwipeGestureRecognizerDirectionRight = 1 << 0,
UISwipeGestureRecognizerDirectionLeft = 1 << 1,
UISwipeGestureRecognizerDirectionUp = 1 << 2,
UISwipeGestureRecognizerDirectionDown = 1 << 3
};
NS_CLASS_AVAILABLE_IOS(3_2) @interface UISwipeGestureRecognizer : UIGestureRecognizer {
@package
CFTimeInterval _maximumDuration;
CGFloat _minimumPrimaryMovement;
CGFloat _maximumPrimaryMovement;
CGFloat _minimumSecondaryMovement;
CGFloat _maximumSecondaryMovement;
CGFloat _rateOfMinimumMovementDecay;
CGFloat _rateOfMaximumMovementDecay;
NSUInteger _numberOfTouchesRequired;
NSMutableArray *_touches;
UISwipeGestureRecognizerDirection _direction;
CGPoint _startLocation;
CGPoint *_startLocations;
CFTimeInterval _startTime;
unsigned int _failed:1;
}
@property(nonatomic) NSUInteger numberOfTouchesRequired; // default is 1. the number of fingers that must swipe
@property(nonatomic) UISwipeGestureRecognizerDirection direction; // default is UISwipeGestureRecognizerDirectionRight. the desired direction of the swipe. multiple directions may be specified if they will result in the same behavior (for example, UITableView swipe delete)
@end So they just define swipe as In iOS7's sources i didn't find any However in IOS7 Human Interface Guidelines there are two events described: At least, i think in |
According to android & iOS references
flick
gesture should be calledswipe
.Details
http://developer.android.com/design/patterns/gestures.html
https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizer_basics/GestureRecognizer_basics.html
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UISwipeGestureRecognizer
P.S.
swipe
gesture is more popular in other touch-events framework. That should ease the transition from them topolymer-gestures
.