WWDC24 SALE: Save 50% on all my Swift books and bundles! >>

Snapshot of SwiftUI or UIKit

Forums > iOS

Hi, I found out as of iOS 14 that the article

"How to render a UIView to a UIImage"

is not compatible with WKWebView on a physical device. However, it's fully supported on the Xcode iOS & iPadOS Simulators. Additionally, the article

"How to convert a SwiftUI view to an image"

is affected too.

Does anyone have any information on this matter?


It appears the the solution for "How to convert a SwiftUI view to an image" does not work in iOS 15. Works perfectly on iOS 14 or below but on iOS 15 the resulting image is down the Y axis and the bottom content is cut off.


I use the solution "How to convert a SwiftUI view to an image" as well in my app and it worked perfectly. It worked on simulators and real devices (iPad and IPhone) in tests for weeks, but with updating to iOS 15 I see the same error mentioned above, the whole image is shifted down and the bottom is cut off, while on top, parts of the embedding view is visible.


Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.