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
class ViewController: UIViewController {
@IBOutlet weak var imgView: UIImageView!
@IBOutlet weak var slideroutlet: UISlider!
@IBOutlet weak var lblValue: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func slider(_ sender: Any) {
lblValue.text = String(slideroutlet.value)
imgView.alpha = CGFloat(slideroutlet.value)
}