Latest 0.0.5
Homepage https://github.com/uxmstudio/UIScreenCapture
License MIT
Platforms ios 8.0, requires ARC
Authors

Version
License
Platform
UIScreenCapture

Simply capture screenshots and create screen recordings from code.

Installation

CocoaPods

UIScreenCapture is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "UIScreenCapture", '~> 0.0.5'

Usage

Capture Screen Recording

// Initialize the screen capture
UIScreenCapture *screenCapture = [UIScreenCapture new];
screenCapture.height = 480.0;
screenCapture.width = 640.0;
screenCapture.frameRate = 15.0;
screenCapture.completionBlock = ^(NSURL *fileURL) {
    NSLog(@"Finished! Video located at: %@", fileURL);
};

// Begin screen capture
[screenCapture startRecording];

dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 10 * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

    // Stop screen capture after ten seconds
    [screenCapture stopRecording];
});

Take Screenshot

[UIScreenCapture takeSnapshot];

Interface

// Variables
@property (nonatomic) CGFloat height;
@property (nonatomic) CGFloat width;
@property (nonatomic) CGFloat frameRate;
@property (nonatomic, strong) UIView *view; // If you wish to capture something other than the whole screen
@property (nonatomic, copy) UIScreenCaptureCompletion completionBlock;

// Record screen
- (void)startRecording;
- (void)stopRecording;

// Create video from images
- (void)createVideoFromImageURLs:(NSArray *)urls withCompletion:(UIScreenCaptureCompletion)completion;
- (void)createVideoFromImages:(NSArray *)images withCompletion:(UIScreenCaptureCompletion)completion;

// Snapshots
+ (UIImage *)takeSnapshot;
+ (UIImage *)takeSnapshotWithSize:(CGSize)size;
+ (UIImage *)takeSnapshotWithSize:(CGSize)size view:(UIView *)view;
+ (NSData *)takeSnapshotGetJPEG;
+ (NSData *)takeSnapshotGetJPEG:(CGFloat)quality;
+ (NSData *)takeSnapshotGetJPEG:(CGFloat)quality size:(CGSize)size;

Author

Chris Anderson:

License

UIScreenCapture is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "UIScreenCapture",
    "version": "0.0.5",
    "summary": "Simply capture screenshots and create screen recordings from code.",
    "description": "Easily capture screenshots and create screen recordings from code.",
    "homepage": "https://github.com/uxmstudio/UIScreenCapture",
    "license": "MIT",
    "authors": {
        "Chris Anderson": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/uxmstudio/UIScreenCapture.git",
        "tag": "0.0.5"
    },
    "source_files": [
        "UIScreenCapture",
        "UIScreenCapture/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This