Type Safely

Type Safely

Create a Default View Body To Apply When One Is Not Provided

Daily Coding Tip 195

Type Safely's avatar
Type Safely
Oct 15, 2022
∙ Paid
Share
landscape photo of mountain
Photo by Cristina Gottardi on Unsplash

I often set properties up in a SwiftUI before I get around to the body property required by the View protocol.

In many previous Daily Coding Tips I got around this by declaring my ContentView type without conforming to the protocol, and later adding View conformance in an extension. Another way to deal with this mig…

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