Add region swapOut, beforeSwapOut

fixes #1718
Is this the right arguments? Should we also pass the view it will be swapped with?