Skip to content
Browse files

Added helper for UIButton

  • Loading branch information...
1 parent 28e8749 commit 583f9037acb0585a0ec9300a1c6ff70ee0b198cb @clayallsopp clayallsopp committed May 9, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/ui_button.rb
View
7 lib/ui_button.rb
@@ -0,0 +1,7 @@
+class UIButton
+ def when(events, &block)
+ @callback ||= {}
+ @callback[events] = block
+ addTarget(@callback[events], action:'call', forControlEvents: events)
+ end
+end

0 comments on commit 583f903

Please sign in to comment.
Something went wrong with that request. Please try again.