SwiftUI Tutorial: Displaying collection data with List View— Todolist App

Rizal Hilman
6 min readJul 20, 2023
SwiftUI List View

Building a List view has never been easier with SwiftUI! To create a List view, we just need to use the List view and define its content inside.

List {
Text("Item 1")
Text("Item 2")
Text("Item 3")
Text("Item ...")
}

Now, let's utilize List view to build a simple Todo list app. Although we won't build a fully functional todo list app, we will be able to show the todo list and open the todo list detail page. Here is a preview of our app:

We will have three views:

  • ContentView: the main view for displaying the todo list
  • StatusIndicator: showing the status of the backlog
  • TodoDetailView: detail todo list view

Getting Started

To get started, create a new SwiftUI project in Xcode. For this tutorial, we'll name our project "SwiftUI Simple TodoList.”

--

--

Rizal Hilman

Tech Mentor at Apple Developer Academy - Batam | Apple Swift Certified Trainer | Apple Professional Learning Specialist | Apple Teacher | WWDC19 Winner