title: how to move one direction in UIScrollView when scrolling
body: <p>I'm new in objective-c. I create <code>UIScrollView</code> object and add in my view with this code:</p>
  
  <pre><code>height = self.view.frame.size.height;
  width = self.view.frame.size.width;
  
  scrollbar = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
  scrollbar.delegate = self;
  scrollbar.backgroundColor = [UIColor whiteColor];
  scrollbar.maximumZoomScale = 1.0;
  scrollbar.minimumZoomScale = 1.0;
  scrollbar.clipsToBounds = YES;
  scrollbar.showsHorizontalScrollIndicator = YES;
  scrollbar.pagingEnabled = YES;
  [scrollbar setContentSize:CGSizeMake(width*4, height*4)];
  [self.view addSubview:scrollbar];
  
  for (int i = 1; i &lt;= 4; i++) {
      first = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
      first.view.frame = CGRectMake((i-1)*width, 0, width, height*4);
      [scrollbar addSubview:first.view];
  
      switch (i) {
            ase 1:
                first.view.backgroundColor = [UIColor blueColor];
                break;
            case 2:
                first.view.backgroundColor = [UIColor redColor];
                break;
            case 3:
                first.view.backgroundColor = [UIColor greenColor];
                break;
            case 4:
                first.view.backgroundColor = [UIColor grayColor];
                break;
            default:
                break;
          }
      }
  </code></pre>
  
  <p>in my code I add 4 view in my ScrollView with different color now I want when scrolling on my ScrollView detect dx &amp; dy (dx: driving distance on Axis.x &amp; dy:driving distance on Axis.y) and check these two variable and when :</p>
  
  <p>Notic: I want when any one touch on ScrollView and moving touch on Axis (x or y) or touch on Both Axis (x and y) check this :</p>
  
  <p><strong>if (dx > dy) disable horizontal scroll and moving in vertical side!!!
  else moving in horizontal side and disable vertical scroll!!!</strong></p>
  
  <pre><code>- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  
      CGRect visibleRect = CGRectMake(scrollView.contentOffset.x, scrollView.contentOffset.y, scrollView.contentOffset.x + scrollView.bounds.size.width, scrollView.contentOffset.y + scrollView.bounds.size.height);
  
      NSLog(@"%f,%f",visibleRect.origin.x,visibleRect.origin.y);
  
      /*NSLog(@"x : %f",scrollView.contentOffset.x);
      NSLog(@"y : %f",scrollView.contentOffset.y);*/
      if (fabsf(scrollView.contentOffset.x) &gt; fabsf(scrollView.contentOffset.y)) {
          NSLog(@"Vertical Side");
      }
      else {
          NSLog(@"Horizontal Side");
      }
  }
  </code></pre>
  
  <p>please guide me guys. I can't disable one side and move another side!!! thanks</p>