title: viewDidLayoutSubviews called after touchesBegan - again and again
body: <p>In <a href="https://github.com/afarber/ios-newbie/tree/master/Scroll" rel="nofollow noreferrer">an iPhone word game</a> I have an <code>UIScrollView</code> (holding <code>UIImageView</code>) and 7 draggable custom <code>UIView</code>s placed initially at the bottom (and outside the scroll view):</p>
  
  <p><img src="https://i.stack.imgur.com/kbmEy.png" alt="app screenshot"></p>
  
  <p>In the single <a href="https://github.com/afarber/ios-newbie/blob/master/Scroll/Scroll/ViewController.m" rel="nofollow noreferrer">ViewController.m</a> I have overwritten <code>viewDidLayoutSubviews</code> so that it always sets the <code>zoomScale</code> of the scroll view - to have the <code>UIImageView</code> fill exactly 100% of the screen width.</p>
  
  <p>This works well - for portrait and landscape modes. And when the app is just started:</p>
  
  <p><img src="https://i.stack.imgur.com/t85Bp.png" alt="portrait"></p>
  
  <p><img src="https://i.stack.imgur.com/xKbi6.png" alt="landscape"></p>
  
  <p><strong>My problem</strong> is however, when I first pinch/zoom/double-tap the scroll view and then move one of the seven <a href="https://github.com/afarber/ios-newbie/blob/master/Scroll/Scroll/Tile.m" rel="nofollow noreferrer">Tile.m</a> views:</p>
  
  <p>Suddenly (not every time) <code>viewDidLayoutSubviews</code> is called after <code>touchesBegan</code>.</p>
  
  <p>This resets the zoom of the scroll view - unexpectedly for the user.</p>
  
  <p><strong>My question</strong> is if there is any way to disable this behavior? </p>
  
  <p>Is it possible to prevent <code>viewDidLayoutSubviews</code> call of the parent, when its child <code>UIView</code> is being touched/dragged?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I've moved the <code>zoomScale</code> setting code from <code>viewDidLayoutSubviews</code> to <code>didRotateFromInterfaceOrientation</code> and the scroll view zoom is okay now, but its <code>contentOffset</code> is reset to <code>{0,0}</code>, when (not always) I drag a Tile - i.e. the scroll view jumps suddenly, the app is unusable.</p>
  
  <p>Adding the following to <code>viewDidLoad</code> hasn't helped:</p>
  
  <pre><code>if ([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)])
     self.automaticallyAdjustsScrollViewInsets = NO;
  </code></pre>