title: Use ReplayKit to record any app on screen
body: <p>I am trying to create an iPhone app that records not only the app's screen but if put into the background it records everything on the screen, including other apps. This is how recording from "Control Center" works. The difference is I want to get access to the video immediately without user intervention, with the user's consent of course. </p>
  
  <p>I've implemented code using ReplayKit2 on iOS 12 that uses an embedded Broadcast Upload Extension. I have not found any examples online that work like this.</p>
  
  <p>I posted the code on Bitbucket: <a href="https://bitbucket.org/breelig/replaykitbroadcasttofile/src/master/" rel="nofollow noreferrer">https://bitbucket.org/breelig/replaykitbroadcasttofile/src/master/</a></p>
  
  <p>The closet similar question I found on SO is: <a href="https://stackoverflow.com/questions/53275187/replaykit-stops-screen-recording-in-background-mode-of-the-application-or-outsid">ReplayKit stops screen recording in background mode of the application or outside the app?</a></p>
  
  <h2>Update</h2>
  
  <p>Based on the good responses by @KaneCheshire and @AndreyA. below and other random sources I was able to develop a solution that works. Please see the code in my BitBucket link above.</p>