Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. BOOL shouldMove = NO;
  2.  
  3. - (void)checkSTU:(id)sender {
  4.  
  5. if (slideGestureRecognizer.state == UIGestureRecognizerStateBegan || slideGestureRecognizer.state == UIGestureRecognizerStatePossible) {
  6.  
  7. NSLog(@"[Ascend] first touch.");
  8.  
  9. int xPoint = [slideGestureRecognizer locationInView:self].x;
  10. int yPoint = [slideGestureRecognizer locationInView:self].y;
  11.  
  12. if (yPoint >= 497.75 && yPoint <= 542.25 && xPoint >= 24.75 && xPoint <= 69.25)
  13. shouldMove = YES;
  14.  
  15.  
  16.  
  17. }
  18.  
  19. if (slideGestureRecognizer.state == UIGestureRecognizerStateChanged) {
  20.  
  21. NSLog(@"[Ascend] X coordinate: %f", [slideGestureRecognizer locationInView:self].x);
  22.  
  23. int xPoint = [slideGestureRecognizer locationInView:self].x;
  24. //int yPoint = [slideGestureRecognizer locationInView:self].y;
  25.  
  26. int labelXPoint = [slideGestureRecognizer locationInView:STULbl].x;
  27.  
  28. NSLog(@"[Ascend]xpoint: %i", xPoint);
  29.  
  30. CGPoint newFrame = STUImgView.center;
  31. newFrame.x = xPoint;
  32. if (shouldMove) {
  33. if (STUImgView.center.x >= 47 && STUImgView.center.x <= 211) {
  34. STUImgView.center = newFrame;
  35. STULbl.alpha = (CGFloat)(100/labelXPoint)-0.3;
  36. }
  37. }
  38. }
  39.  
  40. if (slideGestureRecognizer.state == UIGestureRecognizerStateEnded) {
  41.  
  42. // int xPoint = [slideGestureRecognizer locationInView:self].x;
  43. //int yPoint = [slideGestureRecognizer locationInView:self].y;
  44. NSLog(@"[Ascend] STUImgView center x %f", STUImgView.center.x);
  45. shouldMove = NO;
  46.  
  47. if (STUImgView.center.x >= 211) {
  48. //code
  49. }
  50.  
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement