The tile becomes draggable blow its image because the view containing the tile is auto-resized by it's superview (controller's view) that changes its frame during rotation.
This behaviour can be easily avoided by setting autoresizing mask of the tile view to UIViewAutoresizingNone
(by deselecting all springs and struts in Interface Builder).
Note the tools to debug problems with view sizing like this one:
- LLDB command
po viewVariableOrAddress
(callsdescription
method of its parameter and prints the result). - -[UIView recursiveDescription] called from LLDB by the following command:
po [viewVariableOrAddress recursiveDescription]
. Note that his method is private and must not be called in production code (the app will be rejected otherwise). - Reveal — in a natural GUI, represents the same information that you can get at runtime in debugger console.