Using Apple ReplayKit, you can let your user record gameplay, or in your case, no matter what the user does.
Link to WWDC 2015 presentation included here
:
func startRecording() {
let recorder = RPScreenRecorder.sharedRecorder()
recorder.startRecordingWithMicrophoneEnabled(true) { [unowned self] (error) in
if let unwrappedError = error {
print(unwrappedError.localizedDescription)
} else {
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Stop", style: .Plain, target: self, action: "stopRecording")
}
}
}
func stopRecording() {
let recorder = RPScreenRecorder.sharedRecorder()
recorder.stopRecordingWithHandler { [unowned self] (preview, error) in
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Start", style: .Plain, target: self, action: "startRecording")
if let unwrappedPreview = preview {
unwrappedPreview.previewControllerDelegate = self
self.presentViewController(unwrappedPreview, animated: true, completion: nil)
}
}
}