UIKit snapshot views render empty into UIImage on physical devices, but work in Simulator

Is there a supported way to convert the cached contents of a UIKit snapshot view into a UIImage on physical iOS/iPadOS devices?

A view returned by snapshotView(afterScreenUpdates:) displays correctly on hardware, but drawing that view into a UIGraphicsImageRenderer produces no cached-content pixels. drawHierarchy(in:afterScreenUpdates:) still returns true. The same base experiment succeeds in Simulator.

Feedback Assistant report: FB25336445. A standalone reproducer and measurements are attached there; use the corrected replica-readback-ios-27.0.1-fixed-project.zip attachment.

Tested environments
  • Physical iPhone 15 Pro Max: iOS 27.0.1 (24A446).
  • Physical iPad mini (6th generation): iPadOS 26.6.1 (23G83). Two independent app launches produced identical measurements.
  • Simulator: iPhone 18 Pro / iOS 27.0 and iPhone 15 Pro Max / iOS 26.1.

The app is a standalone UIKit Release build, launched without a debugger or XCTest. It uses an ordinary red UIView and a white UILabel: no WebKit, Liquid Glass, video, secure text fields, third-party libraries, or private API calls.

I have not tested a physical iPhone on the 26 series or iOS 27.0.2. The Simulator and device OS patch versions differ, so this is not a controlled OS-only comparison.

Reproduction
  1. Display a red 240 x 160 UIView containing a white UILabel; allow it to render.
  2. Draw the original view into an image as a positive control.
  3. Call source.snapshotView(afterScreenUpdates: false), attach the replica to the window at the source frame, wait 500 ms, hide the original, then wait another 500 ms.
  4. Draw the attached replica into transparent and cyan-prefilled image contexts.
  5. Add an ordinary red 30 x 30 child UIView to the replica, wait 500 ms, and capture again.
  6. Repeat with replicas from UIWindow.snapshotView and UIScreen.snapshotView.

This is the capture operation, called on the main actor after those waits:

func rasterize(_ target: UIView, cyanBackground: Bool) -> UIImage {
    let format = UIGraphicsImageRendererFormat()
    format.scale = 1
    format.opaque = false

    return UIGraphicsImageRenderer(size: target.bounds.size, format: format)
        .image { context in
            if cyanBackground {
                UIColor.cyan.setFill()
                context.fill(target.bounds)
            }
            let success = target.drawHierarchy(
                in: target.bounds,
                afterScreenUpdates: true
            )
            print("drawHierarchy:", success)
        }
}
Results

On both physical devices:

  • The original 240 x 160 UIView renders normally: all 38,400 pixels are nontransparent.
  • The replica on a transparent target produces zero nontransparent pixels.
  • The replica on a cyan target leaves all 38,400 pixels cyan.
  • Adding an ordinary child view produces approximately 900 red pixels, but the replica's cached contents are still missing.
  • UIView, UIWindow and UIScreen replicas all exhibit the omission, while drawHierarchy returns true.

In both tested Simulators, the base experiment renders the replica contents and overwrites the cyan background. The child-marker addition was tested on physical devices only.

These counts are measured from the CGImage before PNG encoding. Thus “black output” with an opaque context appears to be missing content, not pixels painted black: transparent and cyan targets retain their original contents.

Questions
  1. Is bitmap readback of these snapshot views supported on physical devices, or are they only intended for on-screen composition?
  2. If unsupported, is the Simulator behavior expected, and why does drawHierarchy return success despite omitting the visible cached contents?
  3. Is there a supported API to materialize those cached contents as an image, without starting a screen-recording session? Capturing the original view directly is a useful control, but does not answer how to read back an already-created snapshot.

I found this older AVSampleBufferDisplayLayer discussion, which also describes a correctly displayed snapshot view becoming black when converted to an image. My reproducer uses only ordinary UIKit views; I do not know whether the underlying cause is related.


ReplicaReadback-App.swift.txt(4.7 KB)
iPadOS-26.6.1-measurements.txt(1.0 KB)

Additional physical-device verification (October 27, 2026)

The snapshot-replica bitmap readback issue also reproduces in these configurations:

  • iPhone 15 Pro Max (iPhone16,2), iOS 27.2 (24B119). This is the SAME physical iPhone previously tested on iOS 27.0.1 (24A446), now updated to 27.2.
  • iPad mini (6th generation, iPad14,1), iPadOS 26.6.1 (23G83).

Both configurations were tested with the same standalone public-API App.swift used in the original report, built in Release and launched normally without a debugger or XCTest. Two independent launches on each configuration produced identical measurement results within that configuration.

Results on both configurations:

  • The original 240 x 160 UIView renders correctly: all 38,400 pixels are nontransparent.
  • Its snapshot replica produces zero nontransparent pixels on a transparent target; all 38,400 pixels remain cyan on a cyan-prefilled target.
  • UIWindow and UIScreen replicas also omit their cached contents.
  • A normal 30 x 30 red child added to a replica does render (899 red pixels).
  • drawHierarchy returns true even when the cached contents are missing.
  • Pixel counts are measured before PNG encoding.

On the same iPhone, replica measurements on 27.2 match those on 27.0.1. The original UIView positive control remains fully rendered; its red-pixel count changes by four pixels (37,952 to 37,948).

The omission therefore persists after updating the same iPhone to 27.2, and also occurs on a physical iPad running the 26 series. A physical iPhone on the 26 series is unavailable. These tests concern snapshot-replica bitmap readback, not a new measurement of Liquid Glass appearance or alternative capture APIs.

Measurement summaries are attached below. Full two-run PNG/JSON evidence for both devices has also been added to FB25336445.
replica-ipad-26.6.1-report.txt(1.0 KB)
replica-iphone-27.2-report.txt(1.0 KB)