lib/under_os/ui/switch.rb in under-os-1.1.0 vs lib/under_os/ui/switch.rb in under-os-1.2.0
- old
+ new
@@ -1,14 +1,11 @@
-class UnderOs::UI::Switch < UnderOs::UI::View
- include UnderOs::UI::Editable
-
+class UnderOs::UI::Switch < UnderOs::UI::Input
wraps UISwitch, tag: 'switch'
def initialize(options={})
super
-
- self.value = options[:value] if options[:value]
self.checked = options[:checked] if options[:checked]
+ @_.addTarget self, action: :handle_change, forControlEvents:UIControlEventValueChanged
end
def value
@_value
end