Type Safely

Type Safely

Create @ShapeBuilder So You Can Use The 'some Shape' Opaque Return Type

Daily Coding Tip 077

Millie Sturgeon's avatar
Millie Sturgeon
May 01, 2022
∙ Paid
Image by Magic Creative from Pixabay

We can only build the body of a SwiftUI view because of a result builder called @ViewBuilder.

I introduced result builders in Daily Coding Tip 073, if you want to check that out.

As the View protocol requires @ViewBuilder we do not need to explicitly add this result builder to the body property.

But what if we want to…

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