Chromium Code Reviews| Index: ios/chrome/browser/ui/side_swipe_gesture_recognizer.h |
| diff --git a/ios/chrome/browser/ui/side_swipe_gesture_recognizer.h b/ios/chrome/browser/ui/side_swipe_gesture_recognizer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..24a5a7f02301ed41bbaa0e387017bf2f41b44ec3 |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/side_swipe_gesture_recognizer.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_CHROME_BROWSER_UI_SIDE_SWIPE_GESTURE_RECOGNIZER_H_ |
| +#define IOS_CHROME_BROWSER_UI_SIDE_SWIPE_GESTURE_RECOGNIZER_H_ |
| + |
| +#import <UIKit/UIGestureRecognizerSubclass.h> |
| +#import <UIKit/UIKit.h> |
| + |
| +// This gesture recognizer is used because the default swipe gesture recognizer |
| +// is too restrictive. The default swipe requires a particular velocity and |
| +// distance that Chrome does not require. |
| +// Another benefit of using a custom gesture recognizer is it can fail faster, |
| +// so recognizers that depend on this recognizer can begin faster. |
| +@interface SideSwipeGestureRecognizer : UIPanGestureRecognizer { |
|
sdefresne
2015/04/02 17:20:29
Can you use the occasion to move ivar definition t
|
| + // Starting point of swipe. |
| + CGPoint startPoint_; |
| + // Expected direction of the swipe, based on starting point. |
| + UISwipeGestureRecognizerDirection direction_; |
| +} |
| + |
| +// The distance from the edge of the screen in which a side swipe can start. |
| +@property(nonatomic, assign) CGFloat swipeEdge; |
| +// The distance from the edge of the screen from which a gesture starts. |
| +@property(readonly, nonatomic) CGFloat swipeOffset; |
| +@property(nonatomic, assign) UISwipeGestureRecognizerDirection direction; |
| + |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_UI_SIDE_SWIPE_GESTURE_RECOGNIZER_H_ |