     }
     installConstaints()
     setupAttrs()
-    
+
+    toggleSwitch.addTarget(self, action: #selector(onSwitchStatusChanged), for: .valueChanged)
+
   }
   
   func installConstaints(){
     toggleSwitch.pa_centerY.install()
     toggleSwitch.pa_trailingMargin.eq(FormMetrics.cellPaddingRight).install()
+
+    tipLabel.pa_before(toggleSwitch, offset: 4).install()
+    tipLabel.pa_centerY.install()
     
   }
   

// toggle[x,r15]:sw

open class SwitchCell : StaticTableViewCell,BXBindable{
  open let toggleSwitch = UISwitch(frame:CGRect.zero)
  
  
  public convenience init() {
    self.init(style: .value1, reuseIdentifier: "SwitchCellCell")

    backgroundColor = .white
    textLabel?.font = UIFont.systemFont(ofSize: 15)
    textLabel?.textColor = FormColors.primaryTextColor

    tipLabel.font = UIFont.systemFont(ofSize: 13)
    tipLabel.textColor = FormColors.hintTextColor

  }

  func onSwitchStatusChanged(){
    if showTip{
      tipLabel.text = isOn ? tipOn:tipOff
    }
  }
  
  
  
  open var isOn:Bool{
    get{ return toggleSwitch.isOn }
    set{
      toggleSwitch.isOn = newValue
      onSwitchStatusChanged()
    }
  }
}
