ReactiveCocoa/ReactiveCocoa — pull request #658 by robb (2013-07-10 18:46:41+00:00)
Title: Add +switch:cases:

This adds a generalized alternative to `+if:then:else:` which resembles a switch statement.
It allows to easily select one of many signals, here's an example:

```objective-c
- (RACSignal *)messagesSignal
{
return [RACSignal
switch:RACAbleWithStart(self.updatePriority)
cases:@{
@(CCUpdatePriorityOff): [RACSignal never],
@(CCUpdatePriorityLow): self.pollMessages,
@(CCUpdatePriorityHigh): self.streamMessages
}];
}
```

I understand that this may cause some confusion with `switchToLatest` but I think the naming is apt.

It also doesn't yet handle the case of values being sent over the signal that are not keys in the cases dictionary, I could see adding a `+switch:default:cases:` for that and using `[RACSignal never]` as the default value in `+switch:cases:`