Move a View to its Own File

Build an App Like Lego, with SwiftUI — Tutorial 9

Tom Brodhurst-Hill
Next Level Swift
Published in
4 min readMay 26, 2021

--

Photo by Glen Carrie on Unsplash

1. Introduction

Xcode provides a menu command to Extract Subview from a larger view or scene (which we did in Tutorial 7). But that extracted view still resides in the same file as the original super view. It is best practice to separate each view into its own file.

--

--

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