I’ve added a component to handle left, right, up and down swipe gestures to my set of iOS components.
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!
type TSwipeEvent = procedure of object; TiOSSwipeGestureRecognizer = class(TFmxObject) private FOnSwipeRight : TSwipeEvent; FOnSwipeLeft : TSwipeEvent; FOnSwipeUp : TSwipeEvent; FOnSwipeDown : TSwipeEvent; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; published 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; end;