UISwipeGestureRecognizer Spend a Distance

Any idea if there is an easy way to lengthen the distance that you must walk before you recognize it. The default seems to be really short. This is more than a crane, but hardly. Do I need to create a custom gesture recognizer to redefine this distance?

Thank.

+3
source share
1 answer

The absence of documentary properties for the installation means that there are no documentary properties for this. However, you can create your own gesture recognizer.


To change the default behavior, there are 7 undocumented properties:

@interface UISwipeGestureRecognizer()
@property(assign, nonatomic) CGFloat minimumPrimaryMovement;
@property(assign, nonatomic) CGFloat maximumPrimaryMovement;
@property(assign, nonatomic) CGFloat minimumSecondaryMovement;
@property(assign, nonatomic) CGFloat maximumSecondaryMovement;
@property(assign, nonatomic) NSTimeInterval maximumDuration;
@property(assign, nonatomic) float rateOfMinimumMovementDecay;
@property(assign, nonatomic) float rateOfMaximumMovementDecay;
@end

AppStore, .

+5

Source: https://habr.com/ru/post/1751708/


All Articles