1

Greetings,

I'm trying to get a ui button to have dual identities. If the user pushes it normally, an event fires (this works already). If the user pushes and holds it for some time period (2 seconds for example) a different event fires.

Any suggestions on a way to handle the "hold it down for 2 seconds" event?

Thanks!

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • This is asking the same thing as the newer (and more viewed) [How can you add a UIGestureRecognizer to a UIBarButtonItem as in the common undo/redo UIPopoverController scheme on iPad apps?](http://stackoverflow.com/questions/2655630/how-can-you-add-a-uigesturerecognizer-to-a-uibarbuttonitem-as-in-the-common-undo) . – Brad Larson Mar 17 '11 at 13:30

2 Answers2

1

I believe that your answer lies within this question

Community
  • 1
  • 1
KevinDTimm
  • 14,226
  • 3
  • 42
  • 60
0

That looks good too.....

But I took another approach (should have delayed my question)....

I simply set the current date/time on then push event, and check for the time difference on the release inside event. If longer then xx seconds do the alternate function.

Works like a charm. Sorry for the premature-e-post-ulation...