code: def init_widget(self):
          
          super(UiKitSwitch, self).init_widget()
  
          d = self.declaration
          if d.checked:
              self.set_checked(d.checked)
  
          #: Watch the on property for change
          #: So apparently UISwitch is not KVO compliant...
          # self.widget.addObserver(
          #     self.get_app().view_controller,
          #     forKeyPath="on",
          #     options=UISwitch.NSKeyValueObservingOptionNew|UISwitch.NSKeyValueObservingOptionOld,
          #     context=self.widget
          #)
  
          #: A really ugly way to add the target
          #: would be nice if we could just pass the block pointer here :)
          self.get_app().bridge.addTarget(
              self.widget,
              forControlEvents=UISwitch.UIControlEventValueChanged,
              andCallback=self.widget.getId(),
              usingMethod="onValueChanged",
              withValues=["on"]#,"selected"]
          )
  
          self.widget.onValueChanged.connect(self.on_checked_changed)
docs: Bind the on property to the checked state