class UnderOs::UI::Switch

Public Class Methods

new(options={}) click to toggle source
Calls superclass method UnderOs::UI::Input::new
# File lib/under_os/ui/switch.rb, line 4
def initialize(options={})
  super
  self.checked = options[:checked] if options[:checked]
  @_.addTarget self, action: :handle_change, forControlEvents:UIControlEventValueChanged
end

Public Instance Methods

checked() click to toggle source
# File lib/under_os/ui/switch.rb, line 18
def checked
  @_.on?
end
checked=(flag) click to toggle source
# File lib/under_os/ui/switch.rb, line 22
def checked=(flag)
  @_.setOn flag, animated: true
end
value() click to toggle source
# File lib/under_os/ui/switch.rb, line 10
def value
  @_value
end
value=(value) click to toggle source
# File lib/under_os/ui/switch.rb, line 14
def value=(value)
  @_value = value # just saving it on the instance
end