Getting started with screen recording with ReplayKit on iOS 11

The green line problem come from :

The generate more one file is my fault.

Solven this two problem, but I encounter another problem that call startCapture func at viewDidLoad is fine, when I call in a button IBAction, would face "Error Domain=AVFoundationErrorDomain Code=-11823" at the first time