class MotionWiretap::WiretapControl
Public Class Methods
new(target, &block)
click to toggle source
Calls superclass method
MotionWiretap::WiretapView::new
# File lib/motion-wiretap/ios/wiretap_ios.rb, line 56 def initialize(target, &block) super @control_events = [] end
Public Instance Methods
handle_event(event)
click to toggle source
# File lib/motion-wiretap/ios/wiretap_ios.rb, line 79 def handle_event(event) trigger_changed(event) end
on(control_event, options={}, &block)
click to toggle source
control_event can be any UIControlEventConstant, or any symbol found in wiretap_control_events.rb, or an array of UIControlEventConstants or symbols. Since UIView
implements ‘on` to accept a gesture, this method calls `super` when the symbol isn’t a control
Calls superclass method
MotionWiretap::WiretapView#on
# File lib/motion-wiretap/ios/wiretap_ios.rb, line 65 def on(control_event, options={}, &block) begin control_event = ControlEvents.convert(control_event) self.target.addTarget(self, action: 'handle_event:', forControlEvents: control_event) @control_events << control_event rescue ControlEventNotFound super(control_event, options, &block) else super(nil, options, &block) end return self end
teardown()
click to toggle source
Calls superclass method
MotionWiretap::WiretapView#teardown
# File lib/motion-wiretap/ios/wiretap_ios.rb, line 83 def teardown remove_event = (-> (event) { self.target.removeTarget(self, action: 'handle_event:', forControlEvents: event) }).weak! @control_events.each(&remove_event) super end