3

Here is the start and stop functions.

@IBAction func startRecordingAction(sender: AnyObject) {
            activityView.hidden = false

        // start recording
        recorder.startRecordingWithMicrophoneEnabled(true) { [unowned self] (error) in
            dispatch_async(dispatch_get_main_queue()) {
                [unowned self] in
                self.activityView.hidden = true
            }

            if let error = error {
                print("Failed start recording: \(error.localizedDescription)")
                return
            }

            print("Start recording")
            self.buttonEnabledControl(true)


        }
    }

    @IBAction func stopRecordingAction(sender: AnyObject) {
        activityView.hidden = false

        //end recording
        recorder.stopRecordingWithHandler({ [unowned self] (previewViewController, error) in
            dispatch_async(dispatch_get_main_queue()) {
                self.activityView.hidden = true
            }

            self.buttonEnabledControl(false)

            if let error = error {
                print("Failed stop recording: \(error.localizedDescription)")
                return
            }

            print("Stop recording")
            previewViewController?.previewControllerDelegate = self



            dispatch_async(dispatch_get_main_queue()) { [unowned self] in
                // show preview vindow
                self.presentViewController(previewViewController!, animated: true, completion: nil)
            }
        })
    }
func screenRecorderDidChangeAvailability(screenRecorder: RPScreenRecorder) {
        let availability = screenRecorder.available
        print("Availability: \(availability)\n");
    }

    // MARK: - RPPreviewViewControllerDelegate
    // called when preview is finished
    func previewControllerDidFinish(previewController: RPPreviewViewController) {
        print("Preview finish");

        dispatch_async(dispatch_get_main_queue()) { 
            [unowned previewController] in
            // close preview window
            previewController.dismissViewControllerAnimated(true, completion: nil)
        }
    }

I want to record only a part of screen and I want to show a custom alert, not ReplayKit standard alert message. I can use 3 party pods, no problem. Maybe you can advice me a different way, without ReplayKit.

pableiros
  • 14,932
  • 12
  • 99
  • 105
davudi
  • 117
  • 3
  • 13

1 Answers1

3

Unfortunately, you cannot record a particular UIView for now with/Using Replay Kit.

For recording particular view here are some alternative's hope this helps you out.

https://github.com/wess/Glimpse

https://github.com/adam-roth/screen-cap-view

https://github.com/andydrizen/UIViewRecorder

Hope this helps you out.

souvickcse
  • 7,742
  • 5
  • 37
  • 64
Swifty Codes
  • 992
  • 10
  • 23