0

I would like to take a screenshot of an entire UICollectionView (or at least the "top 10" cells). The view doesn't fit on screen.

How do I programmatically capture a snapshot of a view larger than the iPhone's screen?

1 Answers1

0

The problem of capturing a scroll view's content including the offscreen part has been tackled here many times before, so please, search before asking. (See for example: Getting a screenshot of a UIScrollView, including offscreen parts)

But even that won't help you here, because in particular, a collection view's cells that are not shown on the screen do not even exist; that is what cell reuse is about. So there is in fact nothing in existence to take a screen shot of. The cells you can see are the only cells there are.

To put it another way; the collection view does fit on the screen. What's on the screen is the collection view. There isn't any more of it.

You could perhaps construct in code a drawing that looks somewhat like your collection view, but it could be quite a bit of work.

matt
  • 515,959
  • 87
  • 875
  • 1,141