In a what would be a (yet another) word game for iOS I have a scroll view holding an image view with game board.
And underneath I have draggable custom views representing letter tiles.
For the scroll view I've added a double tap gesture recognizer for toggling its zoomScale (between 50% and 100% image width):

This works well, but I had to disable Autolayout (because otherwise scroll view's contentOffset would jump to {0,0} when I dragged the tiles).
So I had to add the following code to ViewController.m to adjust scroll view's frame after device rotation:
- (void) adjustSubViews
{
_scrollView.frame = CGRectMake(0,
0,
self.view.bounds.size.width,
self.view.bounds.size.height - kHeight - 2 * kPadding);
}
this seems to work too - but my problem is that after first device rotation to landscape and back "something breaks" and the tiles are suddenly draggable by touching underneath them:

Why does it happen please?
Below is an Xcode screenshot (here fullscreen) showing the scroll view properties:

UPDATE: I've added size logging to the Tile.m:
- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSLog(@"%s %@", __PRETTY_FUNCTION__, NSStringFromCGSize(self.frame.size));
[_smallImage setHidden:YES];
[_smallLetter setHidden:YES];
[_smallValue setHidden:YES];
[_bigImage setHidden:NO];
[_bigLetter setHidden:NO];
[_bigValue setHidden:NO];
[self.superview bringSubviewToFront:self];
}
and while initially it logs the expected tile size of 45x45 (set by me in Tile.xib):
-[Tile touchesBegan:withEvent:] {45, 45}
After I rotate the device to landscape and back to portrait I suddenly get the height of 160:
-[Tile touchesBegan:withEvent:] {45, 160}


adjustSubViewsandadjustZoomout ofviewDidLoadanddidRotateFromInterfaceOrientation:, and just put them both inviewWillLayoutSubviews- this will get called on device rotation and afterviewDidLoad. You may want to update the frames of yourTileobjects here too instead of setting those inviewDidLoad. I'm not sure if this will fix your problem, but it may help isolate the issue. - Aaron BragertouchesMoved: github.com/afarber/ios-newbie/blob/master/Scroll/Scroll/Tile.m - Alexander Farber