From 2b21f366c368ee9abefc7ae18d1d6ee3bfd89e09 Mon Sep 17 00:00:00 2001 From: Junior B Date: Sun, 24 May 2015 19:25:11 +0200 Subject: [PATCH] less verbose code for example --- .../IntroductionExampleViewController.swift | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift b/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift index f0bd736f..be18a294 100644 --- a/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift +++ b/RxExample/RxExample/Examples/Introduction/IntroductionExampleViewController.swift @@ -74,16 +74,10 @@ class IntroductionExampleViewController : ViewController { >- subscribeNext { value in let formatter = NSNumberFormatter() if let doubleValue = formatter.numberFromString(value)?.doubleValue { - if doubleValue > 100 { - self.slider.doubleValue = 100 - self.sliderValue.stringValue = "100" - } else if doubleValue < 0 { - self.slider.doubleValue = 0.0 - self.sliderValue.stringValue = "0" - } self.slider.doubleValue = doubleValue + self.sliderValue.stringValue = "\(Int(doubleValue))" } else { - self.slider.doubleValue = 0.0 + self.slider.doubleValue = 0 self.sliderValue.stringValue = "0" } }