objective c - How to swipe NSArray of images in Order using ISwipeGesture iOS 7 -


Hi, Hi in my application, I have an array of images, I swipe to see the image, so I have used swipe gestures in my application. For both left and right but the problem is that the images are not showing, in order to show only two images, please tell me how to solve this problem.

My swipe codes.

  - (IBAction) handle wipe: (UIGestureRecognizer *) sender {// NSLog (@ "swiped"); Int imageIndex = 3; NSArray * images = [[NSArray alloc] initWithObjects: @ "2.jpg", @ "3.jpg", @ "4.jpg", @ "5.jpg", zero]; UISwipeGestureRecognizer guidelines = [[UISwipeGestureRecognizer * Sender direction]]; Switch (Direction) {Case UISwipeGestureRecognizerDirectionLeft: imageIndex++; breakage; Case UISwipeGestureRecognizerDirectionRight: imageIndex--; breakage; Default: Break;} imageIndex = (imageIndex & lt; 0) ? ([Number of images] -1): Image index% [Calculation of images]; Imageview.image = [UIImage imageNamed: [Images ItemAntx: imageIndex]];}   

Swipe gestures have been added to the scene and I have already set an image in the image view but in order that it Do not rule out, in order only tell two images randomly Please tell me where I am doing wrong and how to solve it.

Thanks. < p>

  right_gesture = [[UISwipeGestureRecognizer alloc] initWithTarget: self action: @selector (method); right_gesture.direction = UISwipeGestureRecognizerDirectionLeft; [objSecondView .view addGestureRecognizer: right_gesture]; Right_gesture.delegate = self;   

and in the method ...

  if (varSecondCount == 3) {} else {varSecondCount ++; Switch (varSecondCount) {case 0: [imageView setImage: [UIImage imageNamed: @ "rcz_img1.png"]]; break; Case 1: [imageView set image: [UIImage imageNamed: @ "rcz_img2.png"]]; break; Case 2: [imageView Set Image: [UIImage imageNamed: @ "rcz_img3.png"]]; break; Case 3: [imageView setImage: [UIImage imageNamed: @ "rcz_img4.png"]]; break; Case 4: [imageView Set Image: [UIImage imageNamed: @ "step2_5.png"]]; break; Default: Break; }   

Hope this helps ....

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -