title: UISwitch double tap
body: <p>I currently have a <code>UISwitch</code> that when turned on and off increments and decrements a counter respectively.</p>
  
  <p>When the counter is at 0 the counter will not decrement. Functionally, this works perfectly however I have noticed a bug and wondered if anyone has experienced this.</p>
  
  <p>Essentially if you very very quickly double tap the UISwitch at its far position (fully on or off) the counter will increment twice as I'm imagining the UISwitch isn't fully hitting the off state and is therefore simply adding to the counter again without first decrementing it.</p>
  
  <p>Here's the code I'm using to do the checks on the switch:</p>
  
  <pre><code>// Sliders modified
  
  - (IBAction)personalityChanged:(id)sender {
      if ([personality isOn] ){
          [[[GlobalData sharedGlobalData]personalitySliderValue] replaceObjectAtIndex:currentRecord-1 withObject:@"1"];
          rating ++;
          NSLog(@"The value of personality slider is %@", [[[GlobalData sharedGlobalData]personalitySliderValue] objectAtIndex:currentRecord-1]);
          [personality set]
      }
      else {
          [[[GlobalData sharedGlobalData]personalitySliderValue] replaceObjectAtIndex:currentRecord-1 withObject:@"0"];
          [self subtractFromRating:nil];
          NSLog(@"The value of personality slider is %@", [[[GlobalData sharedGlobalData]personalitySliderValue] objectAtIndex:currentRecord-1]);
      }
      [self checkRating:nil];
  }
  </code></pre>
  
  <p>Then the subtract rating:</p>
  
  <pre><code>// subtract from rating
  
  -(void)subtractFromRating:(id)sender{
      if (rating == 0) {
          // do nothing
      }
      else
      {
          rating --;
      }
  }
  </code></pre>
  
  <p>And finally the result of what happens if the slider is in a position:</p>
  
  <pre><code>// check rating
  
  -(void)checkRating:(id)sender{
      switch (rating) {
          case 0:
              [matchRating setText:@""];
              [ratingGraphic setImage:[UIImage imageNamed:@""]];
              NSLog(@"rating is 0");
              break;
          case 1:
              [matchRating setText:@"Single Match"];
              [ratingGraphic setImage:[UIImage imageNamed:@"ratinggraphic1.png"]];
              NSLog(@"rating is 1");
              break;
          case 2:
              [matchRating setText:@"Potential Match"];
              [ratingGraphic setImage:[UIImage imageNamed:@"ratinggraphic2.png"]];
              NSLog(@"rating is 2");
              break;
          case 3:
              [matchRating setText:@"Great Match"];
              [ratingGraphic setImage:[UIImage imageNamed:@"ratinggraphic3.png"]];
              NSLog(@"rating is 3");
              break;
          case 4:
              [matchRating setText:@"Hot Match"];
              [ratingGraphic setImage:[UIImage imageNamed:@"ratinggraphic4.png"]];
              NSLog(@"rating is 4");
              break;
          default:
              break;
      }
  }
  </code></pre>
  
  <p>Is there a way to make sure the switch goes from the on state to the off fully before returning or a better approach for this?</p>