Calling willMoveParentViewController before removeFromParentViewController as mentioned in method's documentation.