Michael Long
Jul 22, 2023

--

Like most of them, with the exception of breaking out tons of private vars for sub views. If there's one point Apple has made again and again in regard to SwiftUI, it's that there's little to know performance degradation involved in making subviews distinct and separate views and composing views together.

Further, this gives you the chance to make reusable components like CardHeader, LegalFootnote, and NameValueRow that can be used across views and even previewed and styled on their own.

View composition is your friend.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (2)