Type Safely

Type Safely

Share this post

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

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

Share this post

Type Safely
Type Safely
Create @ShapeBuilder So You Can Use The 'some Shape' Opaque Return Type
Share
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…

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