title: How to swipe NSArray of images in Order using ISwipeGesture iOS 7
body: <p>Hi in my application i have array of images i want to view image by swipe so i have used the Swipe Gesture in my application for both left and right but the problem is its not showing the images in order its just showing two images only please tell me how to resolve this issue.</p>
  
  <p>My swipe code.</p>
  
  <pre><code>- (IBAction)handleswipe:(UIGestureRecognizer *)sender {
  
         //NSLog(@"swiped");
         int imageIndex = 3;
        NSArray *images = [[NSArray alloc] initWithObjects:
                                                 @"2.jpg",
                                                 @"3.jpg",
                                                 @"4.jpg",
                                            @"5.jpg", nil];
  
       UISwipeGestureRecognizerDirection direction = [(UISwipeGestureRecognizer *) sender direction];
       switch (direction) {
           case UISwipeGestureRecognizerDirectionLeft:
                 imageIndex++;
                 break;
           case UISwipeGestureRecognizerDirectionRight:
                imageIndex--;
                break;
             default:
                break;
          }
       imageIndex = (imageIndex &lt; 0 )? ([images count] -1):
       imageIndex % [images count];
       imageview.image = [UIImage imageNamed:[images objectAtIndex:imageIndex]];   
      }
  </code></pre>
  
  <p>I have added the Swipe Gesture in image view and i have set one image already in imageview but its not showing in order its only showing two images in randomly please tell me where I'm doing wrong and how to resolve this one.</p>
  
  <p>Thanks.  </p>