title: How to stop Screen Recording in App Swift 4
body: <p>I have one code for detected if user try to screen recorder now I want to stop recording that's mean the red part in left side is stoped</p>
  
  <p>here is my code for detecting now how can I stop recording automatically or dismiss recording in isCaptured == true
  I can't find any code for how to stop </p>
  
  <pre><code>    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
          if (keyPath == "captured") {
  
              let isCaptured = UIScreen.main.isCaptured
  
              if (isCaptured == true) {
  ///How to stop screen recording after 5 sec
                  }
  }
  </code></pre>
  
  <p>here is my code for creating the Screen Recorder now I want to stop this with one button </p>
  
  <pre><code>let broadcastPickerView = RPSystemBroadcastPickerView(frame: CGRect(x:0, y: 0, width: btnRS.frame.width, height: btnRS.frame.height))
      broadcastPickerView.translatesAutoresizingMaskIntoConstraints = false
      if let button = broadcastPickerView.subviews.first as? UIButton {
          button.imageView?.tintColor = UIColor.white
  
      }
  
  
      btnRS.addSubview(broadcastPickerView)
      broadcastPickerView.tintColor = .yellow
      broadcastPickerView.backgroundColor = .clear
      broadcastPickerView.showsMicrophoneButton = true
  
      btnRS.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
  
  
  }
  </code></pre>