Type Safely

Type Safely

Previewing Private SwiftUI View Structures

Daily Coding Tip 089

Millie Sturgeon's avatar
Millie Sturgeon
May 26, 2022
∙ Paid
Image by Jon Pauling from Pixabay

The ListView in yesterday’s Daily Coding Tip presents some challenges when it comes to preview in the SwiftUI. As you can see at the bottom of this code, it is impossible to refer to ListView.ListRow.previews due to it being a private struct. One solution to this is for the private view to conform to the PreviewProvider …

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture