Handling Swipe Gestures in FireMonkey for iOS

I’ve added a component to handle left, right, up and down swipe gestures to my set of iOS components.

Here’s the full set!

NOTE: This component requires that you edit the FMX_Platform_iOS.pas file on the Xcode side to surface mainWindow and a few other things.

Once installed, this component is extremely easy to use. Simply hook up the OnSwipe events that you’d like to handle and you’re done!

TSwipeEvent = procedure of object;

TiOSSwipeGestureRecognizer = class(TFmxObject)
  FOnSwipeRight : TSwipeEvent;
  FOnSwipeLeft : TSwipeEvent;
  FOnSwipeUp : TSwipeEvent;
  FOnSwipeDown : TSwipeEvent;
  constructor Create(AOwner: TComponent); override;
  destructor Destroy; override;
  property OnSwipeRight: TSwipeEvent read FOnSwipeRight write FOnSwipeRight;
  property OnSwipeLeft: TSwipeEvent read FOnSwipeLeft write FOnSwipeLeft;
  property OnSwipeUp: TSwipeEvent read FOnSwipeUp write FOnSwipeUp;
  property OnSwipeDown: TSwipeEvent read FOnSwipeDown write FOnSwipeDown;