How to record iphone gameplays?

I want to start making videos from my iphone playing apps and upload them to youtube. What equipments do I need?

If you are using iOS 8 or later, then you can record your iPhone or iPad device screen by QuickTime. To record screen via QuickTime you must need a Mac running on OS X Yosemite or later.

Follow these simple steps below to record the screen of your iOS device:

1.Connect your iPhone, iPad or iPod touch to your Mac via a Lightning Cable.
2.Open the QuickTime app
3.Go to File and select 'New Movie Recording'.
4.A recording window will appear. You will a see little arrow for drop down menu in front of the record button. Click that arrow and select your iPhone.
5.Select the Mic of your iPhone if you want to record game sounds.
6.Click the Record button. Now perform the tasks on your iOS device that you want to record.
7.Once done tap the stop button and save the video.
8.Done!