Tuesday, January 24, 2012

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!
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;

Enjoy!

83 comments:

  1. How can this be used to scroll a TMemo control on iOS? It is annoying that none of the FM controls respond to touch out of the box - is that by design?

    ReplyDelete
  2. when compiling my demo using Tswipegesture, there is a problem in FPC. mainWindow can not be found. I am trapped, please help me. help!!!!

    ReplyDelete
  3. please tell me how to "surface mainWindow and a few other things", who can tell me thanks a lots!!

    ReplyDelete
  4. Can you please be more helpful and specify exactly what you mean by ..."edit the FMX_Platform_iOS.pas file on the Xcode side to surface mainWindow and a few other things." ? I am able to build on Windows and deploy on Xcode but gives "Cannot find Swiper unit" when I try to build it in xcode. Thank you.

    ReplyDelete
  5. You have to add the Swiper unit to the project on the Xcode side. You may be able to get away with copying it to the Xcode folder, but I usually explicitely add it to the project in Xcode.

    ReplyDelete
  6. Yes, what changes need to be made to "surface MainWindow"?

    We are trying to insert a UIWebView onto a Firemonkey app, and are hung up on this.

    Thanks in advance.

    ReplyDelete
  7. Has anybody worked out placing a UIWebView onto a panel (or onto other 'windowed' object)? scwiecek?

    any help is greatly appreciated :)

    thank you,
    Andy

    ReplyDelete
  8. You need targeted traffic to your website so why not try some for free? There is a VERY POWERFUL and POPULAR company out there who now lets you try their traffic for 7 days free of charge. I am so glad they opened their traffic system back up to the public! Check it out here: http://nsru.net/fdse

    ReplyDelete
  9. [url=http://www.softassembly.com/Swipe.html]Swipe promo code[/url].

    ReplyDelete
  10. You're sure so drastically when it comes to this trouble, forced me to be individually consider it from the wide range of varied attitudes. It has the like individuals 're not required unless it's one thing to execute using Pixie lott! Your personal products fantastic. Constantly look after that!

    ReplyDelete
  11. I leave a response whenever I like a article on a website or if I have something to add to the discussion. Usually it is a result of the passion communicated in the article I read. And on this post %BLOG_TITLE%. I was actually moved enough to post a thought :) I do have 2 questions for you if it's allright. Is it only me or do some of the remarks look as if they are coming from brain dead folks? :-P And, if you are writing at other places, I would like to follow anything fresh you have to post. Could you make a list all of all your shared pages like your Facebook page, twitter feed, or linkedin profile?|

    ReplyDelete
  12. Fast Shipping Delivery To You With Best Enjoy,Choose Your Fashion Polo Clothes From Our Online Store.
    [url=http://www.store-nike-outlet.com]nike store[/url]

    ReplyDelete
  13. click here for the greatest current mortgage rates available

    ReplyDelete
  14. see here for the top i loved this available

    ReplyDelete
  15. get the best inserts anywhere

    ReplyDelete
  16. get the best hands anywhere

    ReplyDelete
  17. go here for the top inserts around

    ReplyDelete
  18. click here for the greatest read more around

    ReplyDelete
  19. click here for the best bright flashlight now available around plus at the best price.

    ReplyDelete
  20. see here for the greatest Led Bulb now available around and at the best price.

    ReplyDelete
  21. redirected here...

    see here for the top public address transmitters now available around plus reasonably priced....

    ReplyDelete
  22. POE clock...

    go here for the greatest digital synchronized clocks currently available around plus at great prices....

    ReplyDelete
  23. clock repair videos...

    Here are the top clock hands wholesale now in stock anywhere and reasonably priced....

    ReplyDelete
  24. clock analog...

    see here for the top innovation wireless systems now available anywhere and at great prices....

    ReplyDelete
  25. multiple time sync...

    get the top click here now available on the market plus reasonably priced....

    ReplyDelete
  26. us...

    Encounter the top metal clock dials currently in stock on the market and at great prices....

    ReplyDelete
  27. clock hands...

    Get the greatest clock dial face fit ups now in stock around and at the best price....

    ReplyDelete
  28. relevant site...

    see here for the top sync clocks for hospitals now available on the market plus reasonably priced....

    ReplyDelete
  29. see...

    get the greatest clock synchronization wirelessly currently available anywhere plus at great prices....

    ReplyDelete
  30. visit...

    Find the greatest parts of a clock now available around plus at the best price....

    ReplyDelete
  31. GPS Receiver...

    go here for the best Building management facilities services now available on the market plus reasonably priced....

    ReplyDelete
  32. Clock making parts...

    Get the greatest clock Inserts videos currently in stock anywhere and reasonably priced....

    ReplyDelete
  33. time synchronazation clocks...

    get the top standard wireless clock now available on the market plus at the best price....

    ReplyDelete
  34. Wireless clocks for schools...

    get the top public address transmitters now in stock anywhere and reasonably priced....

    ReplyDelete
  35. small clock hands...

    Encounter the best get more info here now in stock on the market plus at the best price....

    ReplyDelete
  36. relevant web page...

    see here for the greatest outdoor clocks for schools now available on the market and at great prices....

    ReplyDelete
  37. try these guys...

    Get the best USA Made clock faces now available anywhere plus at great prices....

    ReplyDelete
  38. wireless clocks for hospitals...

    see here for the greatest sync wireless clocks now in stock on the market and at great prices....

    ReplyDelete
  39. quartz clock fit-ups...

    Encounter the greatest clock hands currently available around plus at great prices....

    ReplyDelete
  40. read what he said...

    see here for the top check it out here currently in stock anywhere plus at the best price....

    ReplyDelete
  41. visit the following internet site...

    Find the best Clock making parts currently available on the market plus reasonably priced....

    ReplyDelete
  42. hour hands for clocks...

    Find the top hands for clocks now in stock around plus at great prices....

    ReplyDelete
  43. clock repair videos...

    Get the greatest clock motor suppliers now in stock around and reasonably priced....

    ReplyDelete
  44. clock hands wholesale...

    Encounter the best USA Made clock faces now available on the market and at great prices....

    ReplyDelete
  45. resources...

    click here for the top time synchronazation clocks now available anywhere and at the best price....

    ReplyDelete
  46. relevant web site...

    go here for the best FCC site license now in stock around plus at the best price....

    ReplyDelete
  47. plastic dial hand...

    Encounter the top metal clock hands now in stock on the market and at great prices....

    ReplyDelete
  48. view...

    Find the top quartz clock fit-ups currently available anywhere and at the best price....

    ReplyDelete
  49. Are you able to share the curler blind you used?

    Visit my page :: kidfurniche

    ReplyDelete
  50. Visit Homepage...

    Encounter the greatest hands for clocks now available around plus at great prices....

    ReplyDelete
  51. small clock inserts...

    Get the greatest best hands for clocks now available on the market and reasonably priced....

    ReplyDelete
  52. visit link...

    Encounter the best clock mechanisms currently in stock on the market and at the best price....

    ReplyDelete
  53. visit my homepage...

    Here are the greatest Clock kits and dials currently in stock on the market and at great prices....

    ReplyDelete
  54. try this out...

    Find the top mantle clock replacement motor currently in stock around and at great prices....

    ReplyDelete
  55. try these out...

    Here are the best clock making replacement parts currently available on the market plus reasonably priced....

    ReplyDelete
  56. check this site out...

    Click here for the greatest car insurance now available on the market plus reasonably priced....

    ReplyDelete
  57. updated blog post...

    Get the greatest best hands for clocks currently available around and reasonably priced....

    ReplyDelete
  58. clock second hands...

    Get the top large clock hands now in stock anywhere and reasonably priced....

    ReplyDelete
  59. tide movement motors...

    Find the top Clock repair parts now available on the market plus reasonably priced....

    ReplyDelete
  60. faux wood...

    Here are the top clock building videos currently in stock anywhere plus at the best price....

    ReplyDelete
  61. clock hands...

    Here are the greatest how to build your own clock currently in stock on the market plus at the best price....

    ReplyDelete
  62. view...

    Get the top day light savings time currently in stock on the market and at great prices....

    ReplyDelete
  63. try this out...

    Get the best continuous sweep handshands currently available around plus reasonably priced....

    ReplyDelete
  64. hour hands for clocks...

    Encounter the top best clock hands now in stock on the market plus at great prices....

    ReplyDelete
  65. wall clock insert...

    Here are the greatest how to build your own clock currently available around plus reasonably priced....

    ReplyDelete
  66. clock motor suppliers...

    Find the top crystal dial face now available on the market and at great prices....

    ReplyDelete
  67. Clock kits and dials...

    Find the best time clock now available on the market and reasonably priced....

    ReplyDelete
  68. how to replace clock hands...

    Encounter the best metal inserts now in stock around plus at great prices....

    ReplyDelete
  69. clock minute hands...

    Find the best clock hands currently in stock around and at the best price....

    ReplyDelete
  70. skin serums...

    Go here for the greatest wrinkles around the eyes now in stock on the market and reasonably priced....

    ReplyDelete
  71. clock fitups...

    Find the top clock repair videos currently available on the market and reasonably priced....

    ReplyDelete
  72. Brightest Tactical Flashlights...

    get the best ultra bright flahlight now available around and at the best price....

    ReplyDelete
  73. visit the following internet page...

    Encounter the greatest clock inserts suppliers currently in stock on the market and reasonably priced....

    ReplyDelete
  74. Simon DU2 Flashlights...

    go here for the greatest best compact flashlight now in stock anywhere plus at great prices....

    ReplyDelete
  75. just click the following internet site...

    see here for the top small tactical flashlight currently available around plus at the best price....

    ReplyDelete
  76. 18650 rechargeable battery...

    click here for the top powerful led flashlight now available around and reasonably priced....

    ReplyDelete
  77. clock second hands...

    Here are the best best clock fitups and dials currently in stock on the market plus at great prices....

    ReplyDelete
  78. he has a good point...

    see here for the best best law enforcement flashlight currently available around plus reasonably priced....

    ReplyDelete
  79. best hands for clocks...

    Find the greatest tide movement motors now in stock around plus at great prices....

    ReplyDelete