From iPhone Development Wiki
Revision as of 13:03, 30 August 2013 by Bushe (talk | contribs)
Jump to: navigation, search
Cydia Package
Developer Ryan Petrich
Package ID com.rpetrich.layersnapshotter
Latest Version 1.0

Adds APIs to snapshot UIViews and CALayers.

LayerSnapshotter Header

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@interface CALayer (Snapshot)
- (UIImage *)renderSnapshotWithScale:(CGFloat)scale;

@interface UIView (Snapshot)
- (UIImage *)renderSnapshot;

@interface UIImage (Saving)
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)atomically;

Example Use

UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
UIImage *imageOfView = [newView renderSnapshot];


ModMyI Package Info for LayerSnapShotter
rpetrich Slide from WWJC 2013