Adapting a SwiftUI View for top-level or enclosed
20:58 13 Dec 2025

Let’s say I have an e-mail reader than can also open some e-mail archive formats. When I get an e-mail file, I open it using a view that’s designed for a message. When I get an archive, I open it to a list view of the entries. But when I look at an individual message, I want to reuse the single-message View. Can a View be designed for both uses? This includes possibly using different methods to pass the message data to the View.

swiftui