rubymotion/sugarcube — pull request #111 by spnkr (2013-12-16 15:06:57+00:00)
Title: Added a new gesture, on_press_begin, that fires once for a long press. on_press_begin works with UIActionSheets, which the on_press gesture has problems with.

Opening a UIActionSheet from within a UILongPressGestureRecognizer (i.e. UIView.on_press { ... }) opens two UIActionSheets because the long press gesture is continuous and the gesture's state needs to be checked in the handler:

```
#this opens two identical action sheets when pressed (not good)
view.on_press do
UIActionSheet.alert(nil, buttons: ['Cancel', "Delete", "Foo", "Bar"]) do |pressed|
# ...
end
end
```

This pull request adds a new gesture, `on_press_begin` that checks the state of the gesture before firing the handler:
```
#this opens one action sheet when pressed
view.on_press_begin do
UIActionSheet.alert(nil, buttons: ['Cancel', "Delete", "Foo", "Bar"]) do |pressed|
# ...
end
end
```

based on:
http://stackoverflow.com/questions/13003384/uiactionsheet-called-twice
http://stackoverflow.com/questions/7907671/ios-uiactionsheet-presented-from-longpress-gesture-on-a-button-erroneously-requi