ReplayKit is a framework in iOS 9+ which allows you to record screen and audio (including voice). All system events like notifications and music from third-party apps (Apple Music, Spotify, etc.) are ignored from the video. Once you are finished, a popup is displayed which allows users to share or save the video to their camera roll.
There is also a broadcasting feature in iOS 10+ which allows users of your app to stream to other broadcast-enabled apps installed on their device.