1

I have a complex UIView with lots of custom subviews, and I need to make a visual copy of it as a new UIView appearing with that rasterized content.

So far I do it by calling renderInContext: to get a new UIImage, but maybe you know a better way.

Rok Jarc
  • 18,765
  • 9
  • 69
  • 124
Proud Member
  • 40,078
  • 47
  • 146
  • 231

1 Answers1

1

Using renderInContext: is Apple's recommended way to rasterize a view hierarchy. I believe it is the only way to do it in the SDK using Apple APIs.

sgonzalez
  • 1,086
  • 9
  • 24
  • 1
    NB Note Tommy's awesome answer on this http://stackoverflow.com/questions/4334233/how-to-capture-uiview-to-uiimage-without-loss-of-quality-on-retina-display – Fattie Jan 01 '14 at 21:28