Creating the Title view
Let’s get started by creating a new Xcode project – I’m calling it Find the Colors. We will build this project from the top down, with all of the code placed in a VStack
to organize the views vertically.
The first objective here will be to give the UI a title; it’s not a lot of code, but we’ll still put it in its own file anyway. So, create a new SwiftUI View file, and call it TitleView
, then add the following code to the body
property:
struct TitleView: View { var body: some View { HStack { Text("Find").foregroundColor(.red) Text("The").foregroundColor(.green) Text("Color").foregroundColor(.blue) &...