GitHub logo maeganjwilson / taskList

CoreData and SwiftUI task list

This post is going to walk through how to make a task list app that stores the task in Core Data.

This app will have the following features:

  • Add a task
  • Complete a task
  • Delete a task
  • Persist data if the app is closed

Here is what the finished app will look like

Finished app "design"

The finished app can be found in this GitHub repo:

1. Create a new single page iOS app

Create a new Xcode project for a single view iOS app.

Check the boxes for SwiftUI and to use Core Data.

2. CoreData Entities and Attributes

The first thing we need to do is add an entity to the CoreData model. To do this, open ProjectName.xcdatamodeld, where ProjectName is what you called the project in Step 1, and click on Add Entity at the bottom of the window. Name the new entity Task.

The image below highlights…

View on GitHub