I have a slider and label in my swift project. On the storyboard, I control dragged my slider onto my controller class for that page and created an outlet and also an action
Swift 3: Select .allEvents for its UIControlEvents.
slider.addTarget(self, action: #selector(ViewController.updateKmsLabel(sender:)), for: .allEvents)
// To use
func updateKmsLabel(sender: UISlider!) {
let value = Int(sender.value)
DispatchQueue.main.async {
self.kmsLabel.text = "\(value)"
print("Slider value = \(value)")
}
}