title: Shake gesture works on simulator, but not iPhone
body: <p>I have some code in my app which I use to detect shake, once the device is shaken the background image is changed, some elements on screen are hidden &amp; some are unhidden. If you shake it again it returns back to the original display... this works perfectly on the simulator, but not at all on my actual iPhone 5S!</p>
  
  <p>If I shake the iPhone, I see the changes flash up but it then goes back to the original view in less than a second. Here is my code:</p>
  
  <pre><code>- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
  {
  if (motion == UIEventSubtypeMotionShake)
  {
      UIImage *iPhone5backgroundDO = [UIImage imageNamed:@"image1.png"];
      UIImage *iPhone4backgroundDO = [UIImage imageNamed:@"image2.png"];
      UIImage *iPhone5background = [UIImage imageNamed:@"image3.png"];
      UIImage *iPhone4background = [UIImage imageNamed:@"image4.png"];
  
      if (_backgroundImage.image == iPhone5background) {
          [UIView animateWithDuration:0.5 animations:^(void) {
              self.backgroundImage.image = iPhone5backgroundDO;
              _yearsOut.alpha = 0.0;
              _yearsLabel.alpha = 0.0;
              _monthsOut.alpha = 0.0;
              _monthsLabel.alpha = 0.0;
              _daysOut.alpha = 0.0;
              _hoursOut.alpha = 0.0;
              _minsOut.alpha = 0.0;
              _secsOut.alpha = 0.0;
              _daysOnlyOut.alpha = 1.0;
              _daysLabel.frame = CGRectMake(139, 273, 42, 21);
              _hoursOutDO.alpha = 1.0;
              _hoursLabel.frame = CGRectMake(41, 374, 52, 21);
              _minsOutDO.alpha = 1.0;
              _minsLabel.frame = CGRectMake(126, 374, 66, 21);
              _secsOutDO.alpha = 1.0;
              _secsLabel.frame = CGRectMake(212, 374, 71, 21);
          }];
      } if (_backgroundImage.image == iPhone5backgroundDO) {
          [UIView animateWithDuration:0.5 animations:^(void) {
              self.backgroundImage.image = iPhone5background;
              _yearsOut.alpha = 1.0;
              _yearsLabel.alpha = 1.0;
              _monthsOut.alpha = 1.0;
              _monthsLabel.alpha = 1.0;
              _daysOut.alpha = 1.0;
              _hoursOut.alpha = 1.0;
              _minsOut.alpha = 1.0;
              _secsOut.alpha = 1.0;
              _daysOnlyOut.alpha = 0.0;
              _daysLabel.frame = CGRectMake(226, 331, 42, 21);
              _hoursOutDO.alpha = 0.0;
              _hoursLabel.frame = CGRectMake(45, 457, 52, 21);
              _minsOutDO.alpha = 0.0;
              _minsLabel.frame = CGRectMake(125, 457, 66, 21);
              _secsOutDO.alpha = 0.0;
              _secsLabel.frame = CGRectMake(210, 457, 71, 21);
          }];
      } if (_backgroundImage.image == iPhone4background) {
          [UIView animateWithDuration:0.5 animations:^(void) {
              self.backgroundImage.image = iPhone4backgroundDO;
              _yearsOut.alpha = 0.0;
              _yearsLabel.alpha = 0.0;
              _monthsOut.alpha = 0.0;
              _monthsLabel.alpha = 0.0;
              _daysOut.alpha = 0.0;
              _hoursOut.alpha = 0.0;
              _minsOut.alpha = 0.0;
              _secsOut.alpha = 0.0;
              _daysOnlyOut.alpha = 1.0;
              _daysLabel.frame = CGRectMake(139, 273, 42, 21);
              _hoursOutDO.alpha = 1.0;
              _hoursLabel.frame = CGRectMake(43, 374, 52, 21);
              _minsOutDO.alpha = 1.0;
              _minsLabel.frame = CGRectMake(127, 374, 66, 21);
              _secsOutDO.alpha = 1.0;
              _secsLabel.frame = CGRectMake(213, 374, 71, 21);
          }];
      } else if (_backgroundImage.image == iPhone4backgroundDO) {
          [UIView animateWithDuration:0.5 animations:^(void) {
              self.backgroundImage.image = iPhone4background;
              _yearsOut.alpha = 1.0;
              _yearsLabel.alpha = 1.0;
              _monthsOut.alpha = 1.0;
              _monthsLabel.alpha = 1.0;
              _daysOut.alpha = 1.0;
              _hoursOut.alpha = 1.0;
              _minsOut.alpha = 1.0;
              _secsOut.alpha = 1.0;
              _daysOnlyOut.alpha = 0.0;
              _daysLabel.frame = CGRectMake(212, 271, 45, 21);
              _hoursOutDO.alpha = 0.0;
              _hoursLabel.frame = CGRectMake(57, 371, 49, 21);
              _minsOutDO.alpha = 0.0;
              _minsLabel.frame = CGRectMake(122, 371, 66, 21);
              _secsOutDO.alpha = 0.0;
              _secsLabel.frame = CGRectMake(198, 371, 71, 21);
          }];
      }
  }
  } 
  </code></pre>
  
  <p>Is this an issue with my code? Or am I simply trying to do something that is not possible?</p>