calabash/calabash-ios-server — pull request #26 by jmoody (2013-10-15 14:18:37+00:00)
Title: 0.9.x adds a LPSliderOperation to ease the pain of interacting with UISliders

## motivation

interacting with UISliders is difficult.

### solution

the operation sets the value of the slider using:

```
[slider setValue:targetValue animate:animate]
```

and then loops over the target/action pairs and performs the selector on the slider.

```
[target performSelector:sel withObject:slider];
```

## other approaches we have used

### 1. use query to change the value of the slider directly

```
> query("slider marked:'#{slider_id}'", {setValue:5}, {animated:1})
[
[0] "*****"
]
```

this works.

visually, the slider changes value and subsequent queries return the correct value:

```
> query("slider marked:'#{slider_id}'", :value).first
5
```

unfortunately no `UIEvents` occur.

this is a problem because changing the value of the slider often causes an update to the UI.

consider this Scenario:

```
Scenario: emoticon should change when slider is moved
When I change the "emotions" slider to 2, I should see the "happy" emoticon
When I change the "emotions" slider to -2, I should see the "sad" emoticon
When I change the "emotions" slider to -0.4, I should see the "bored" emoticon
```

when you change the value of the slider, the emoticon should change. if you use query to set the value, the emoticon will not change.

### 2. UITapGestureRecognizer + custom touch function

in my apps, i work around this by adding a `UITapGestureRecognizer` to the slider and use a custom touch function.

this is a feature that most of my clients want any way.

the custom touch function can be found in [briar/lib/control/slider.rb](https://github.com/jmoody/briar/blob/master/lib/briar/control/slider.rb).