CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ | 
| LangLanguage | Obj-CObjective C | 
| License | MIT | 
| ReleasedLast Release | Feb 2015 | 
Maintained by David Hernandez.
UITableView/UIScrollView Category to get really easy, smart and instant screenshot images like no other library out there for iOS 5+ devices.
This is a tableview on the simulator:
And here is the full screenshot image that you get by selecting the first row (full screenshot image):
pod 'DHSmartScreenshot'to your Podfile and run pod install. It will install the most recent version of DHSmartScreenshot.
Alternatively you could copy all the files in the Classes/ directory into your project. Be sure 'Copy items to destination group's folder' is checked.
Import the header: #import "DHSmartScreenshot.h"
Call
UIImage * tableViewScreenshot = [self.tableView screenshot];to get a full screenshot of your tableView instance or see below to know what method to call and get a custom screenshot that better fits your needs.
There are some methods to customize the way you want to take the screenshot. Each one of them is self descriptive and works as you could expect, take a look:
- (UIImage *)screenshot;- (UIImage *)screenshotOfCellAtIndexPath:(NSIndexPath *)indexPath;- (UIImage *)screenshotOfHeaderViewAtSection:(NSUInteger)section;- (UIImage *)screenshotOfFooterViewAtSection:(NSUInteger)section;- (UIImage *)screenshotExcludingAllHeaders:(BOOL)withoutHeaders
                       excludingAllFooters:(BOOL)withoutFooters
                          excludingAllRows:(BOOL)withoutRows;- (UIImage *)screenshotExcludingHeadersAtSections:(NSSet *)headerSections
                       excludingFootersAtSections:(NSSet *)footerSections
                        excludingRowsAtIndexPaths:(NSSet *)indexPaths;- (UIImage *)screenshotOfHeadersAtSections:(NSSet *)headerSections
                         footersAtSections:(NSSet *)footerSections
                          rowsAtIndexPaths:(NSSet *)indexPaths;- (UIImage *)screenshotOfVisibleContent;Sure :) please send a pull-request or raise an issue. It is always good to know how to make things better, yay!
David Hernandez ([email protected])
DHSmartScreenshot is under the MIT License.