Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. - (void)viewDidLoad
  2.  
  3. pos = v1.center;
  4. NSLog(@"POSITION === %f",pos.x);
  5.  
  6. [NSTimer scheduledTimerWithTimeInterval:0.05
  7. target:self
  8. selector:@selector(rotateBoundary)
  9. userInfo:nil
  10. repeats:YES];
  11.  
  12. [super viewDidLoad];
  13.  
  14.  
  15. //[self performSelector:@selector(rotateBoundary) withObject:self afterDelay:5.0];
  16. // Do any additional setup after loading the view, typically from a nib.
  17.  
  18. if (pos.x>=20 && pos.x<=290 && pos.y==25)
  19. {
  20. NSLog(@"Top left to right.");
  21. pos.x+=5;
  22. v1.center = pos;
  23. NSLog(@"pos.x === %f",pos.x);
  24. }
  25. if(pos.x >= 290 && pos.y<=430)
  26. {
  27. NSLog(@"Right top to down.");
  28. pos.y+=5;
  29. v1.center = pos;
  30. NSLog(@"pos.y === %f",pos.y);
  31. }
  32.  
  33. if(pos.y == 430 && pos.x>=20)
  34. {
  35. NSLog(@"Down right to left.");
  36. pos.x-=5;
  37. v1.center = pos;
  38. NSLog(@"pos.x === %f",pos.x);
  39. }
  40. if (pos.x <= 20 && pos.y>=25)
  41. {
  42. NSLog(@"Down left to top.");
  43. pos.y-=5;
  44. v1.center = pos;
  45. NSLog(@"pos.y === %f",pos.y);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement