To mirror your iPhone, iPad, or iPod Touch you will need to have an Apple TV (2nd generation or later) with the latest Apple TV software (click here to learn how to check for updates). To get started, swipe up from the bottom bezel on your device’s screen to display the Control Center, where you will find a button labeled Screen Mirroring.
UPDATE: For Apple devices running iOS 12.0, swipe from the upper-right corner of the screen to bring up the Control Center.
Press the Screen Mirroring button to bring up a list of nearby Apple TVs or displays. Select the Apple TV or display that you’d like to AirPlay to.
When you start AirPlay and the TV displays a passcode, you will need to enter the passcode on the iOS device. Once the code has been enter, press OK to begin mirroring to your TV.
When you want to stop mirroring via AirPlay, you just need to bring up the Control Center again, press Screen Mirroring and press Stop Mirroring.