title: objective C enable UIScrollView scroll while UIGestureRecognizerStateChanged
body: <p>I added a <code>-(void) detectTouch: (UIPanGestureRecognizer *) event</code> for <code>UIScrollView</code> and detecting the angle on which user is moving his finger. My task is to scroll the <code>UIScrollView</code> horizontally only when user is moving the finger between 0 - 30 degrees (just to make sure he is drawing a horizontal straight line) otherwise I have to disable the <code>UIScrollView</code> scroll.</p>
  
  <p>I am detecting the angle by drawing a triangle using the touch starting point and ending point.</p>
  
  <p><strong>Problem:</strong> I enabled the <code>UIScrollView</code> scroll when the angle is &lt; 30 degrees but this is not working on the first time. Although I enabled scroll using <code>scrollEnabled = YES</code> it is working only when user is stopped touching the screen (taking the finger from the screen).</p>
  
  <p>The following code I used to </p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self PanGesture:self.view callBack:@selector(detectTouch:) delegate:self];
      incrementer = 0;    
  }
  
  -(void) detectTouch: (UIPanGestureRecognizer *) event{
      // Calculating point A on gesture starts
      if(event.state == UIGestureRecognizerStateBegan){
          pointA.x = fabs([event translationInView:event.view].x);
          pointA.y = fabs([event translationInView:event.view].y);
  
          NSLog(@"A: %f, %f", pointA.x, pointA.y);
      }
  
      incrementer += 1;
  
      // Start calculating Point B, Point C on calling this function 3 times
      if(incrementer &gt;= 3){
  
          // Calculating point C
          pointC.x = fabs([event translationInView:event.view].x);
          pointC.y = fabs([event translationInView:event.view].y);
  
          NSLog(@"C: %f, %f", pointC.x, pointC.y);
  
          // calculate pointB using A, C
          pointB.x = fabs(pointC.x);
          pointB.y = fabs(pointA.y);
  
          NSLog(@"B: %f, %f", pointB.x, pointB.y);
  
          float X = pointB.x - pointA.x;
          float Y = pointC.y - pointB.y;
          float angle = (atan(fabs(Y) / fabs(X)) * 180 / M_PI);
  
          if(angle &gt; 30){
              // This disable is not working on while user is moving the finger
              self.myScrollView.scrollEnabled = NO;
              NSLog(@"UIScroll Disabled");
          }else{
              // This enable is not working on while user is moving the finger
              self.myScrollView.scrollEnabled = YES;
              NSLog(@"UIScroll Enabled");
          }
  
          incrementer = 0;
      }
  }
  </code></pre>
  
  <p>How can I enable <code>UIScrollView</code> scroll while user is moving the touch?</p>