Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
without checking for recognizer.state==UIGestureRecognizerStateBegan, if you call a new UIActionSheet from inside a when_pressed handler two identical UIActionSheets are instantiated and displayed:
view.when_pressed do
UIActionSheet.alert("Log out?", buttons: ['Cancel', "Log out"]) do |pressed|
if pressed=="Log out"
#do something
end
end
end
this update fixes when_pressed to work as expected. that is, to only show a single UIActionSheet when the above code is executed.
without checking for recognizer.state==UIGestureRecognizerStateBegan, if you call a new UIActionSheet from inside a when_pressed handler two identical
UIActionSheet
s are instantiated and displayed:this update fixes
when_pressed
to work as expected. that is, to only show a single UIActionSheet when the above code is executed.see also: http://stackoverflow.com/questions/15363311/uigesturerecognizerstatebegan-calling-twice-in-ios-6