Creating and Combining Views

The lesson you are about to undertake comes directly from the big Apple itself (the company, not the city). In my experience, most of Apple’s tutorials are hard to follow because they seem to be oriented more towards professional developers and assume that whoever is using the tutorial has a lot of prior knowledge. This tutorial is the exception because it it is clearly written and well structured for early stage SwiftUI developers. I worry that Apple may already fired whoever created this lesson for writing too clearly :).

Joking aside, some parts of this tutorial will likely be very basic and familiar to you and mainly will serve as practice. The tutorial will also introduce some new concepts and presents a different perspective from the tutorials we have followed up to this point. In particular, I like their explanation about how SwiftUI view files are set up into two structs: one that serves as a ‘view’ for content and layout, and another that handles the preview for the other struct.

Version Alert

If you have updated to the latest version of Xcode, some parts of this tutorial may not work exactly as claimed,  but you should be able to figure it out anyway!

In section Five of this lesson, Use UIKit and SwiftUI Views Together, you will learn how to use UIKit to display a map view within a SwiftUI framework. Plus, as the title suggests, this lesson thoroughly covers the process of creating and combining separate views into just one.

Click below to start the lesson

https://developer.apple.com/tutorials/swiftui/creating-and-combining-views