Git Product home page Git Product logo

dhsmartscreenshot's Introduction

DHSmartScreenshot

UITableView/UIScrollView Category to get really easy, smart and instant screenshot images like no other library out there for iOS 5+ devices.

Screenshots

This is a tableview on the simulator:

iOS TableView on Simulator

And here is the full screenshot image that you get by selecting the first row (full screenshot image):

Screenshot Taken - Example

Installation

  1. The preferred way of installation is via CocoaPods. Just add
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.

Usage

  1. Import the header: #import "DHSmartScreenshot.h"

  2. 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.

Methods

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;

Contribution

Sure :) please send a pull-request or raise an issue. It is always good to know how to make things better, yay!

Author

David Hernandez ([email protected])

License

DHSmartScreenshot is under the MIT License.

dhsmartscreenshot's People

Contributors

davidman avatar yangruixuan avatar perlmunger avatar ptescher avatar readmecritic avatar wezsietato avatar kekearif avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.