SwiftUI Tutorial: Displaying collection data with List View— Todolist App
6 min readJul 20, 2023
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.”