From b6815fbe541d0254c34198d108cdb76bb2b1375d Mon Sep 17 00:00:00 2001 From: Junior B Date: Sun, 24 May 2015 19:26:34 +0200 Subject: [PATCH] added slider and info textfield in disposable bag --- .../IntroductionExampleViewController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift b/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift index be18a294..b98b579c 100644 --- a/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift +++ b/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift @@ -55,13 +55,6 @@ class IntroductionExampleViewController : ViewController { } >- disposeBag.addDisposable - disposeButton.rx_tap() - >- subscribeNext { [unowned self] _ in - println("Unbound everything") - self.disposeBag.dispose() - } - >- disposeBag.addDisposable - // Slider slider.rx_valueChange() @@ -69,6 +62,7 @@ class IntroductionExampleViewController : ViewController { >- subscribeNext { value in self.sliderValue.stringValue = "\(Int(value))" } + >- disposeBag.addDisposable sliderValue.rx_text() >- subscribeNext { value in @@ -81,6 +75,14 @@ class IntroductionExampleViewController : ViewController { self.sliderValue.stringValue = "0" } } + >- disposeBag.addDisposable + + disposeButton.rx_tap() + >- subscribeNext { [unowned self] _ in + println("Unbound everything") + self.disposeBag.dispose() + } + >- disposeBag.addDisposable } deinit {