All Projects → MosheBerman → ScrollViewSnapshotter

MosheBerman / ScrollViewSnapshotter

Licence: MIT License
A demo project showing how to correctly snapshot the contents UIScrollView and its subclasses.

Programming Languages

swift
15916 projects

ScrollViewSnapshotter

A demo project showing how to correctly snapshot the contents UIScrollView and its subclasses.

About:

Historically, the suggested approach to snapshotting a scrollview was to resize the scroll view's frame to match its contentSize. This became inconvenient with the introduction of autolayout on iOS.

This example scrolls through the contents of a scrollview subclass (in this case a collection view) and generates a PDF.

The magic comes from translating the core graphics current transformation matrix along with the contentOffset. Check out the ScrollViewSnapshotter class for implementation details and a ton of notes. Those notes are also available on my blog.

License:

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].