Question

How do I take a UIImage and store it preferably as NSData (to write to a file)? Is there some obvious method out there, or could someone provide a code snippet?

Thanks in advance!

PS. My next question will probably be for a code snippet to capture the current screen image. The snippets I've seen so far appear to be serious overkill for what I need.

Was it helpful?

Solution

You can serialize a UIImage using UIImagePNGRepresentation() or UIImageJPEGRepresentation().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top