There are a several techniques that you can use to grab a screenshot of a view on the iOS platform, and here’s a nice simple category that allows you to do it without needing to worry about grabbing the context called MLScreenshot by Marius Landwehr.
With MLScreenshot you can grab a screenshot of an image with just a single line of code.
This code from the readme shows how easily it can be done:
UIImage *screenshot = [view screenshot];
You can find MLScreenshot on Github here.
Thanks to Juan for the submission.
- iOS UIView Category Allowing You To Set Up Customizable Animation Properties
- Library Providing An Easy Way To Apply Animations To A UIView With Custom Easing Functions
- UIView Category Adding Simple Frame Changes And Command Chaining
- Custom UIView Tutorial – 5-Star Ratings View
- Open Source iOS Library For Adding Basic Touch Handling To A UIView Instantly
Original article: Handy Category That Allows You To Take A Screenshot Of A UIView With One Line Of Code
©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.