This is a demo to show the difficulty in grabbing a snapshot of a CATiledLayer-backed view.
NOTE: As of 813fcb this has been worked around using manual re-rendering of each tile making up the current image. To see the non-working example, start at c3e00f instead.
Relevant discussions:
- http://stackoverflow.com/questions/9122388/taking-image-snapshot-of-catiledlayer-backed-view-in-uiscrollview
- https://devforums.apple.com/message/612341
Note the difference between the first segment, which renders the main view including the pink subview, and the second segment, which renders a blank gray area instead of the map view.
The map view is from the Alpstein Route-Me fork, which is essentially, in order:
- A generic
UIViewcontaining - A
UIScrollViewthat pans & zooms containing - A
UIViewsubview backed by aCATiledLayer.
Note that the private API UIGetScreenImage() captures the whole snapshot accurately in both cases. I've not found another method yet which does.