Class: MotionWiretap::WiretapControl

Inherits:
WiretapView show all
Defined in:
lib/motion-wiretap/ios/wiretap_ios.rb

Instance Attribute Summary

Attributes inherited from WiretapKvo

#property, #value

Attributes inherited from WiretapTarget

#target

Instance Method Summary collapse

Methods inherited from WiretapView

#handle_gesture

Methods inherited from WiretapKvo

#bind_to, #initialize, #observeValueForKeyPath, #teardown, #trigger_changed

Methods inherited from WiretapTarget

#initialize

Methods inherited from Wiretap

#and_then, #cancel!, #combine, #dealloc, #enqueue, #filter, #initialize, #listen, #map, #on_error, #queue, #reduce, #teardown, #trigger_changed, #trigger_changed_on, #trigger_completed, #trigger_completed_on, #trigger_error, #trigger_error_on

Constructor Details

This class inherits a constructor from MotionWiretap::WiretapKvo

Instance Method Details

#handle_eventObject



59
60
61
# File 'lib/motion-wiretap/ios/wiretap_ios.rb', line 59

def handle_event
  trigger_changed
end

#on(control_event, options = {}, &block) ⇒ Object

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



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/motion-wiretap/ios/wiretap_ios.rb', line 46

def on(control_event, options={}, &block)
  begin
    control_event = ControlEvents.convert(control_event)
    self.target.addTarget(self, action: :handle_event, forControlEvents: control_event)
  rescue ControlEventNotFound
    super(control_event, options, &block)
  else
    super(nil, options, &block)
  end

  return self
end