That is some View

To explore the components of a view, you will create your own. You will start with the view responsible for displaying the title of a task in the task list. Create a new file using FileNewFile... or Command-N. Select the Swift File template, name the file TaskView.swift, and make sure it will be saved in the Shared group.

The file opens with the familiar import statement import Foundation. You will need to import the SwiftUI framework so that you can work with the elements it provides.

The SwiftUI framework imports the Foundation framework for its own use, so you do not need to manually import both. Replace import Foundation with import SwiftUI, then define a struct that conforms to the View protocol. Ignore the error ...

Get Swift Programming: The Big Nerd Ranch Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.