Define Properties for a View

Build an App Like Lego, with SwiftUI — Tutorial 10

Tom Brodhurst-Hill
Next Level Swift
Published in
8 min readJun 2, 2021

--

Photo by Adyant Pankaj on Unsplash

1. Introduction

A component is most flexible when we declare “properties” to customize differently for each instance.

For a view component, the properties are best declared as subviews, such as an image or text, or as a view attribute such as color. We usually set a…

--

--

iOS developer and architect for BareFeetWare. Builds apps for enterprise and startups. Runs workshops on building apps like Lego.