//
//  ViewController.swift
//  RxSwift-example1
//
//  Created by sandesh sardar on 23/05/19.
//  Copyright © 2019 sandesh sardar. All rights reserved.
//

import UIKit
import RxSwift
import RxCocoa

class ViewController: UIViewController {
    
    @IBOutlet weak var slider: UISlider!
    @IBOutlet weak var sliderValue: UILabel!

    let disposeBag = DisposeBag() // for memory management
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.slider.rx.value // made slider as observable
            
            //subscribe to above observable
            .subscribe(onNext: { slidervalue in
               self.sliderValue.text = "\(slidervalue)"
                print(slidervalue)
            }).disposed(by: disposeBag)
    }
}

git clone https://sandeshsss@bitbucket.org/sandeshsss/rxswift-example1.git