Closed dmarkow closed 10 years ago
You can use the built in constants, like UIControlEventTouchUpInside, instead of the .uicontrolevent method. On Aug 13, 2014 5:28 PM, "Dylan Markow" notifications@github.com wrote:
I only required sugarcube-events and couldn't get it to work, until I realized it was calling .uicontrolevent on the events symbol argument passed in to .on().
I'm new to sugarcube, so I'm not sure if it would be appropriate to explicitly require sugarcube-constants inside of sugarcube-events?
It does look like some of the files do something like this, e.g. sugarcube-core.rb https://github.com/rubymotion/sugarcube/blob/master/lib/sugarcube-core.rb has:
require File.join(File.dirname(FILE), 'sugarcube-coregraphics.rb')require File.join(File.dirname(FILE), 'sugarcube-to_s.rb')
— Reply to this email directly or view it on GitHub https://github.com/rubymotion/sugarcube/issues/149.
Does that make sense?
Oops, sorry for not replying. Yes, makes sense, something like this?
button.on(UIControlEventTouchUpInside) { my_code }
Yup, that should work!
I only required
sugarcube-events
and couldn't get it to work, until I realized it was calling.uicontrolevent
on theevents
symbol argument passed in to.on()
.I'm new to sugarcube, so I'm not sure if it would be appropriate to explicitly require
sugarcube-constants
inside ofsugarcube-events
?It does look like some of the files do something like this, e.g. sugarcube-core.rb has: