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!

81 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. [url=http://www.softassembly.com/Swipe.html]Swipe promo code[/url].

    ReplyDelete
  9. 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
  10. 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
  11. click here for the greatest current mortgage rates available

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

    ReplyDelete
  13. get the best inserts anywhere

    ReplyDelete
  14. get the best hands anywhere

    ReplyDelete
  15. go here for the top inserts around

    ReplyDelete
  16. click here for the greatest read more around

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

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

    ReplyDelete
  19. redirected here...

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

    ReplyDelete
  20. POE clock...

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

    ReplyDelete
  21. clock repair videos...

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

    ReplyDelete
  22. clock analog...

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

    ReplyDelete
  23. multiple time sync...

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

    ReplyDelete
  24. us...

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

    ReplyDelete
  25. clock hands...

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

    ReplyDelete
  26. relevant site...

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

    ReplyDelete
  27. see...

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

    ReplyDelete
  28. visit...

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

    ReplyDelete
  29. GPS Receiver...

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

    ReplyDelete
  30. Clock making parts...

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

    ReplyDelete
  31. time synchronazation clocks...

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

    ReplyDelete
  32. Wireless clocks for schools...

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

    ReplyDelete
  33. small clock hands...

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

    ReplyDelete
  34. relevant web page...

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

    ReplyDelete
  35. try these guys...

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

    ReplyDelete
  36. wireless clocks for hospitals...

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

    ReplyDelete
  37. quartz clock fit-ups...

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

    ReplyDelete
  38. read what he said...

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

    ReplyDelete
  39. visit the following internet site...

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

    ReplyDelete
  40. hour hands for clocks...

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

    ReplyDelete
  41. clock repair videos...

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

    ReplyDelete
  42. clock hands wholesale...

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

    ReplyDelete
  43. resources...

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

    ReplyDelete
  44. relevant web site...

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

    ReplyDelete
  45. plastic dial hand...

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

    ReplyDelete
  46. view...

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

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

    Visit my page :: kidfurniche

    ReplyDelete
  48. Visit Homepage...

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

    ReplyDelete
  49. small clock inserts...

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

    ReplyDelete
  50. visit link...

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

    ReplyDelete
  51. visit my homepage...

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

    ReplyDelete
  52. try this out...

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

    ReplyDelete
  53. try these out...

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

    ReplyDelete
  54. check this site out...

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

    ReplyDelete
  55. updated blog post...

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

    ReplyDelete
  56. clock second hands...

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

    ReplyDelete
  57. tide movement motors...

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

    ReplyDelete
  58. faux wood...

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

    ReplyDelete
  59. clock hands...

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

    ReplyDelete
  60. view...

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

    ReplyDelete
  61. try this out...

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

    ReplyDelete
  62. hour hands for clocks...

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

    ReplyDelete
  63. wall clock insert...

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

    ReplyDelete
  64. clock motor suppliers...

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

    ReplyDelete
  65. Clock kits and dials...

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

    ReplyDelete
  66. how to replace clock hands...

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

    ReplyDelete
  67. clock minute hands...

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

    ReplyDelete
  68. skin serums...

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

    ReplyDelete
  69. clock fitups...

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

    ReplyDelete
  70. Brightest Tactical Flashlights...

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

    ReplyDelete
  71. visit the following internet page...

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

    ReplyDelete
  72. Simon DU2 Flashlights...

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

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

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

    ReplyDelete
  74. 18650 rechargeable battery...

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

    ReplyDelete
  75. clock second hands...

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

    ReplyDelete
  76. he has a good point...

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

    ReplyDelete
  77. best hands for clocks...

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

    ReplyDelete

Note: Only a member of this blog may post a comment.