title: ReplayKit: startRecording() completion handler is never entered
body: <p><strong>Problem description</strong></p>
  
  <p>The startRecording() completion handler is never entered, even though the "Allow screen recording in $AppName" pop-up was shown. The "Allow screen recording in $AppName" pop-up is shown occasionally. This happens also when I remove the app, restart the device and do a clean/build on the project. I'm using an iPad Air 2 with iOS 11 and Xcode 9.</p>
  
  <p><strong>Research</strong></p>
  
  <p>This problem seemed to be an issue in earlier versions as well, see here: <a href="https://stackoverflow.com/questions/40033653/replaykit-startrecording-sometimes-never-enters-completion-handler">replaykit startrecording sometimes never enters completion handler</a>
  I can't approve that turning off WiFi or having a stable internet connection solves this problem, neither has this problem being fixed in iOS 11.</p>
  
  <p>Here is the code I'm using:</p>
  
  <pre><code>@IBAction func recordButtonTapped(_ sender: UIButton) {
      if !recorder.isRecording {
          startRecording(sender)
      } else {
          stopRecording(sender)
      }
  }
  
  private func startRecording(_ sender: UIButton) {
      guard recorder.isAvailable else {
          print("Recording is not available at this time.")
          // Display UI for recording being unavailable
          return
      }
  
      recorder.startRecording(handler: { (error) in
          guard error == nil else {
              print("There was an error starting the recording.")
              print(error!)
              return
          }
  
          print("Started Recording Successfully")
          DispatchQueue.main.async {
              sender.setTitle("Stop Recording", for: .normal)
              sender.setTitleColor(.red, for: .normal)
          }
      })
  }
  </code></pre>