Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sample project to show difficulty in grabbing a snapshot of a CATiledLayer-backed view.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 TiledLayerSnapTest.xcodeproj
Octocat-spinner-32 TiledLayerSnapTest
Octocat-spinner-32 alpstein-route-me @ ce16b38
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 README.md
README.md

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:

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:

  1. A generic UIView containing
  2. A UIScrollView that pans & zooms containing
  3. A UIView subview backed by a CATiledLayer.

Note that the private API UIGetScreenImage() captures the whole snapshot accurately in both cases. I've not found another method yet which does.

Something went wrong with that request. Please try again.