UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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?

4      

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.

4      

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.

3      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

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.