Recording your iPhone screen is useful for creating guides, game videos or movies of other activities you do with your phone. The device does not currently have a built-in feature that can capture screen images, but you can use QuickTime on Mac OS X, the Shou app, or Display Recorder, which is only available on jailbroken phones.
Steps
Method 1 of 3: Using QuickTime on Mac OS X Yosemite (iOS 8.x and later)

Step 1. Connect the iPhone to a computer running Mac OS X Yosemite or later
Click on the Apple logo and select "About This Mac" to confirm that the operating system is OS X Yosemite or later. If you are using a Windows computer or an older version of OS X, follow the steps described in methods two and three of the guide

Step 2. Open QuickTime, then select "File"

Step 3. Select "Record New Movie"
The registration window will open on your computer.

Step 4. Click the arrow you see just to the right of the QuickTime "Record" button

Step 5. Select "iPhone" under Camera and the microphone of your choice
You can use your computer's built-in microphone, or your phone's if you prefer to record sounds in real time.

Step 6. Click the QuickTime "Record" button
The app will start recording the phone screen.

Step 7. Perform the activities you want to record

Step 8. Click the QuickTime "Stop" button once the recording is finished

Step 9. Click on "File", then on "Save"
The video will be saved on your computer and you can share it via email, on social media or wherever you prefer.
Method 2 of 3: Using the Shou App (iOS 7.x through iOS 8.x)

Step 1. Open Safari on your iPhone and open the following page:
shou.tv/i. This is the official website of the Shou app, which allows you to record your phone screen without resorting to jailbreaking or using a computer.

Step 2. Press "Install" when prompted
The iPhone will take a few moments to install Shou; Once done, you will see the app icon on the Home screen.

Step 3. Open the Shou app, then press "Authorize"
This will confirm that you want to run Shou on your iPhone.

Step 4. Press "Continue" within the app
The App Store will open and you can install the free Shou TV app, which allows you to view broadcasts. You need to use two Shou apps to record the screen and play the video using this method: the recording app you just downloaded and the playback app available on the App Store.

Step 5. Click on "Install", then wait for the operation to finish
The app icon will appear on the Home screen.

Step 6. Open the Shou TV app, then follow the onscreen instructions to create a free account

Step 7. Close the Shou TV app, then open the Shou recording app again

Step 8. Press "Record Screen"
The app will start creating a video by filming the images on the iPhone display. Until the registration is complete, you will see a red bar at the top of the screen.

Step 9. Perform the activities you want to record

Step 10. Press "Stop" in the Shou recording app when you want to end the session
The video will be saved on the phone.

Step 11. Press the square button in the upper right corner of Shou to access and share the recordings
Method 3 of 3: Use Display Recorder (iOS Only with Jailbreak)

Step 1. Open Cydia on your jailbroken iPhone
The Display Recorder app is available for free on jailbroken devices.
If necessary, follow these steps to jailbreak the iPhone. Display Recorder is only available through Cydia

Step 2. Search and install Ryan Petrich's "Display Recorder"
In the past, the app was available on the App Store, but was removed because it used private APIs, a practice that violates the App Store terms and conditions.

Step 3. Launch Display Recorder and press "Settings"

Step 4. Press "Record Type" and select "Audio and Video"

Step 5. Press "Capture Method" and select "Direct Access"

Step 6. Press "Record", then the red record button
The app will start recording the phone screen.

Step 7. Perform the activities you want to record
Until the registration is complete, you will see a red bar at the top of the screen.

Step 8. Press on the red bar at the top of the screen and press "Stop" when you have finished recording

Step 9. Press "Recorded Items"
At the beginning of the list you will see the last video you recorded and which you can share via YouTube, Dropbox or the service of your choice.