Latest 0.3.0
Homepage https://github.com/kevinsumios/KSScreenCapture
License MIT
Platforms ios 9.0
Dependencies CocoaLumberjack
Authors

A tool that can capture your screen’s action including audio recorder.

Demo

KSScreenCapture demo

  1. Clone the project in local.

  2. Access to the Demo directory and run pod install in terminal.

  3. Run KSScreenCaptureDemo.xcworkspace in XCode and you will see a demo application as the gif above.

Introduce

It is used to capture your iOS application’s screen including audio recording. Install the library via cocoapod is recommended.

Besides, this library also include a audio recorder name KSAudioCapture to use the AVAudioRecorder functions. The benifit using KSAudioCapture is that it can help you deal with the permission problem, and you can just call it without handle the permission granting problem.

Install

Add in your Podfile:

pod 'KSScreenCapture'

Include ‘KSScreenCapture.h’ wherever you want to capture your screen.

Support up to iOS 9.

Usage

Basic screen capture function

  1. Initialize with target and record layer:

    KSScreenCapture *capture = [[KSScreenCapture alloc] initWithTarget:self CaptureLayer:recordView.layer];

    The recordView’s width and height should be times of 32!

  2. Start record with success/failure block:

    [capture startRecordSuccess:successCallback fail:failCallback];
  3. Declare your view controller implement the KSScreenCaptureDelegate method, and hit the delegate method when capture is done. You can handle the video source file from the videoPath in the block by youself:

    - (void)KSScreenCaptureDidFinish:(KSScreenCapture *)capture path:(NSString *)videoPath {
    // Handle the video source from videoPath
    
    }
  4. Or you can just save the video in the photo album with one line of code which will handle the permission issue for you:

    [capture saveVideoAtPathToSavedPhotosAlbum:videoPath completeSeletor:nil];

Audio recorder function

You can also use the KSAudioCapture for audio recording only. Include the KSaudioCapture.h header file wherever you want to use it.

  1. Initialize the audio capture with file name, target and audio setting. Only target is required, other parameters can be nil by just use the default value.

    audioCapture = [[KSAudioCapture alloc] initWithFileName:nil target:self setting:nil];
  2. Start record with success/failure block:

    [audioCapture startRecordSuccess:successCallback fail:failCallback];
  3. Declare your view controller implement the KSAudioCaptureDelegate method, and hit the delegate method when capture is done. You can handle the audio source file from the url in the block by youself:

    - (void)KSAudioCaptureDidFinishWithURL:(NSURL *)url successfully:(BOOL)flag {
    // Handle the audio source from file url
    
    }

Acknowledgement

This tool is base on Blazeice’s work, thanks to Blazeice as well as wayne li.

Latest podspec

{
    "name": "KSScreenCapture",
    "version": "0.3.0",
    "summary": "A tool that can capture your screen's action including audio recorder.",
    "description": "It is base on Blazeice's work which can be find originally in https://github.com/Blazeice/ScreenAndAudioRecordDemoScreenAndAudioRecordDemo. Thanks to Blazeice and wayne li.",
    "homepage": "https://github.com/kevinsumios/KSScreenCapture",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kevin Sum": "kevin-sum@hotmail.com"
    },
    "source": {
        "git": "https://github.com/kevinsumios/KSScreenCapture.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": [
        "*.{h,m}",
        "CoreGraphics/**/*.{h,m}",
        "THC/**/*.{h,m}"
    ],
    "dependencies": {
        "CocoaLumberjack": [
            "~> 2.3.0"
        ]
    }
}

Pin It on Pinterest

Share This