title: Combining multiple signal not working using Reactive Cocoa
body: <p>I am following this tutorial: <a href="http://www.raywenderlich.com/62699/reactivecocoa-tutorial-pt1" rel="noreferrer">http://www.raywenderlich.com/62699/reactivecocoa-tutorial-pt1</a>. It is working for username and password field.</p>
  
  <p>I am trying to create sign up form which contains three fields: email, password, confirmPassword.</p>
  
  <p>I have validated email address (working perfectly)
  I have validated password like this:</p>
  
  <p>password should be at least 6 characters and both password and confirmPassword must be same.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>RACSignal *validEmailSignal =
  [emailTextField.rac_textSignal
   map:^id(NSString *text) {
       return @([text isValidEmailAddress]);
   }];
  
  RACSignal *validPasswordSignal =
  [passwordTextField.rac_textSignal
   map:^id(NSString *text) {
       return @([text isEqualToString:self.confirmPasswordTextField.text] &amp;&amp; text.length &gt;5);
   }];
  
  RACSignal *validConfirmPasswordSignal =
  [confirmPasswordTextField.rac_textSignal
   map:^id(NSString *text) {
       return @([text isEqualToString:self.passwordTextField.text] &amp;&amp; text.length &gt;5 );
   }];
  
  [[validEmailSignal
    map:^id(NSNumber *emailValid) {
        return [emailValid boolValue] ? [UIColor greenColor] : [UIColor redColor];
    }]
   subscribeNext:^(UIColor *color) {
       emailTextField.layer.borderColor=[color CGColor];
       emailTextField.layer.borderWidth= 1.0f;
  
   }];
  
  [[validPasswordSignal
    map:^id(NSNumber *passwordValid) {
        return [passwordValid boolValue] ? [UIColor greenColor] : [UIColor redColor];
    }]
   subscribeNext:^(UIColor *color) {
       passwordTextField.layer.borderColor=[color CGColor];
       passwordTextField.layer.borderWidth= 1.0f;
       confirmPasswordTextField.layer.borderColor=[color CGColor];
       confirmPasswordTextField.layer.borderWidth= 1.0f;
   }];
  
  [[validConfirmPasswordSignal
    map:^id(NSNumber *passwordValid) {
        return [passwordValid boolValue] ? [UIColor greenColor] : [UIColor redColor];
    }]
   subscribeNext:^(UIColor *color) {
       passwordTextField.layer.borderColor=[color CGColor];
       passwordTextField.layer.borderWidth= 1.0f;
       confirmPasswordTextField.layer.borderColor=[color CGColor];
       confirmPasswordTextField.layer.borderWidth= 1.0f;
   }];
  
  
  RACSignal *signUpActiveSignal =
  [RACSignal combineLatest:@[validEmailSignal, validPasswordSignal, validConfirmPasswordSignal]
                    reduce:^id(NSNumber *emailValid, NSNumber *passwordValid, NSNumber *confirmPasswordValid) {
                        return @([emailValid boolValue] &amp;&amp; [passwordValid boolValue] &amp;&amp; [confirmPasswordValid boolValue]);
                    }];
  
  
  [signUpActiveSignal subscribeNext:^(NSNumber *signupActive) {
  
      NSLog(@"sign up button enabled : %hhd", [signupActive boolValue]);
      _signUpButton.enabled = [signupActive boolValue];
  }];
  </code></pre>
  
  <p>Here, if I take only emailValid's value, it is sending 1 when valid. But if I include all three values, it always returns 0 even if all are valid.</p>
  
  <p>Here are snap shots of the simulator:</p>
  
  <p><img src="https://i.stack.imgur.com/hMgpl.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/fmykW.png" alt="enter image description here"></p>
  
  <p>I just wanted to enable "Sign up" button when all three fields are valid. I also want disable "Go" button on the keyboard till validation success.</p>