Skip to content

MosheBerman/ScrollViewSnapshotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages