Shaking your iPhone is a way to get it to recalibrate its sensors. If you're having trouble getting the screen to rotate properly, or if an app isn't responding correctly, shaking your phone can help.