Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Previewing Private SwiftUI View Structures

Previewing Private SwiftUI View Structures

Daily Coding Tip 089

Millie Sturgeon's avatar
Millie Sturgeon
May 26, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Previewing Private SwiftUI View Structures
Share
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 …

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share