A short SwiftUI example showing how ImageRenderer converts a view into a UIImage or CGImage. I build a simple behaviour ticket view, use a Save button to render it to an image, and display the saved result behind a toggle...
After nearly shelving my SwiftUI tickets app over concerns that exporting tickets was beyond my expertise, I discover an iOS 16 feature that makes the task straightforward, plus existing code examples for rendering SwiftUI views to PDF. The post reflects on the lesson of investigating before assuming something is hard, and notes remaining work on layout and share behaviour...
After updating my iPhone to iOS 16, I found my app would no longer run until Developer Mode was enabled. I briefly cover where to find the setting (in Privacy and Security) and note that it requires a reboot and re-authentication...