In this series we build a persistent todo app using SwiftUI. We'll create custom controls, implement text editing and sorting of rows. Finally we'll see how to implement persistence using Boutique.
Length: about 2 hours
Kicking off a new series on building a Todo App in SwiftUI. In this episode we focus primarily on the preliminary data structure, deciding who owns this data and when to use State versus Bindings when separating our app into distinct views.
In this episode we design a checkbox for our todo UI. We see how we can stroke and fill shapes, how to use InsettableShape, and how to apply a shadow without applying it to every view in the hierarchy.
In this episode we make the todos editable and implement keyboard avoidance. We create a "new todo" button and then set up programmatic control over focus. Along the way we'll see why choosing a proper Hashable value is important.
In this episode we'll implement swipe to delete so we can remove todo items.
In this video we discuss a couple of options for implementing drag to reorder so that we can reorder our todos. We also implement a feature to automatically move completed todos to the bottom, and bringing them back when unchecked.
Now that we have a working Todo app, it's time to focus on persistence, so that our changes are kept when we launch the app. This will change the structure slightly, as we'll bring in a popular new library called Boutique and its Store to provide this facility. We'll also introduce the concept of a "controller", which is more of a model controller than a controller you might be familiar with in UIKit MVC.
In this episode we fix an issue that caused our sorting logic to be lost after adding persistence.