summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorPtyl Dragon <ptyl@cloudon.com>2013-11-01 13:09:28 +0200
committerJan Holesovsky <kendy@collabora.com>2013-11-15 16:52:00 +0100
commit1974d99b60a235f39a868347438b4fc5a17db741 (patch)
treea52f00d3ce6c189404426c2e31e83c38cf2718db /ios
parent427c55bbc1e16f5aaf74dca67c1ea6436f1032a1 (diff)
UISteppers now go down as well
Change-Id: I06e1b7fec490ec373a9775915d6dc2c30ce805f1
Diffstat (limited to 'ios')
-rw-r--r--ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m8
1 files changed, 5 insertions, 3 deletions
diff --git a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
index 22d98fa0a47e..1107eef91609 100644
--- a/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
+++ b/ios/shared/ios_sharedlo/objective_c/view_controllers/MLOTestingTileParameter.m
@@ -48,7 +48,7 @@ static const CGFloat DEFAULT_STEP_VALUE = 1;
stepper.autorepeat = YES;
stepper.continuous = NO;
[stepper addObserver:self forKeyPath:@"value"
- options: NSKeyValueObservingOptionNew
+ options: NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld
context:0];
return stepper;
}
@@ -57,8 +57,10 @@ static const CGFloat DEFAULT_STEP_VALUE = 1;
{
if (object == self.dataStepper) {
- NSNumber * floatNumber = change[NSKeyValueChangeNewKey];
- CGFloat value = [self currentDataValue] + [floatNumber floatValue];
+ NSNumber * newNumber = change[NSKeyValueChangeNewKey];
+ NSNumber * oldNumber = change[NSKeyValueChangeOldKey];
+
+ CGFloat value = [self currentDataValue] + [newNumber floatValue] - [oldNumber floatValue];
if(value == ((NSInteger) value)){
self.data.text = [[NSNumber numberWithInteger:(NSInteger) value] stringValue];