Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BOOL shouldMove = NO;
- - (void)checkSTU:(id)sender {
- if (slideGestureRecognizer.state == UIGestureRecognizerStateBegan || slideGestureRecognizer.state == UIGestureRecognizerStatePossible) {
- NSLog(@"[Ascend] first touch.");
- int xPoint = [slideGestureRecognizer locationInView:self].x;
- int yPoint = [slideGestureRecognizer locationInView:self].y;
- if (yPoint >= 497.75 && yPoint <= 542.25 && xPoint >= 24.75 && xPoint <= 69.25)
- shouldMove = YES;
- }
- if (slideGestureRecognizer.state == UIGestureRecognizerStateChanged) {
- NSLog(@"[Ascend] X coordinate: %f", [slideGestureRecognizer locationInView:self].x);
- int xPoint = [slideGestureRecognizer locationInView:self].x;
- //int yPoint = [slideGestureRecognizer locationInView:self].y;
- int labelXPoint = [slideGestureRecognizer locationInView:STULbl].x;
- NSLog(@"[Ascend]xpoint: %i", xPoint);
- CGPoint newFrame = STUImgView.center;
- newFrame.x = xPoint;
- if (shouldMove) {
- if (STUImgView.center.x >= 47 && STUImgView.center.x <= 211) {
- STUImgView.center = newFrame;
- STULbl.alpha = (CGFloat)(100/labelXPoint)-0.3;
- }
- }
- }
- if (slideGestureRecognizer.state == UIGestureRecognizerStateEnded) {
- // int xPoint = [slideGestureRecognizer locationInView:self].x;
- //int yPoint = [slideGestureRecognizer locationInView:self].y;
- NSLog(@"[Ascend] STUImgView center x %f", STUImgView.center.x);
- shouldMove = NO;
- if (STUImgView.center.x >= 211) {
- //code
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement