-
Share data in an application
Many blog posts are responses to my students’ questions, and this one is no different. Often, my students need to build fast prototypes without saving permanent data and want to avoid writing complicated code with Core Data or the newer SwiftData. They frequently ask, “How can we share data across the application without passing it…
-
SwiftData – Episode III°
In this episode about SwiftData we’ll learn: Before we start, I advise you to review the previous episodes (SwiftData – Episode I°- Introduction and SwiftData – Episode – II° – Delete/) Edit Data First of all, we will create the view to edit a ProjectItem: A part from the variable used to dismiss the sheet…
-
SwiftData – Episode II° – Delete
In this episode, we’ll learn how to delete data. Let’s start with deletion in the projects (I advise you to take a look at the previous episode because I will start from that code). The first step is to ensure that when we delete a project, we also delete all the pomodoros for that project…
-
SwiftData – Episode I°- Introduction
The goal of this tutorial is to learn SwiftData by building a Pomodoro app (we’ll be using code from another one of my tutorials). SwiftData replaces CoreData, and I can say that CoreData is a pain for any iOS developer. With SwiftData, things are much simpler. Enough with the introduction, let’s start. In this post,…
-
AppStorage – UserDefaults
In this post, we’ll explore how to use AppStorage. Commonly, UserDefaults is employed to save small amounts of data, such as user preferences in an app. However, it comes with certain limitations: What is AppStorage? It’s a wrapper for UserDefaults that allows us to save and load data from UserDefaults without having to directly call…
-
Form And Group
Here are two ways to group widgets in SwiftUI: Form The official documentation defines a form as: “A container for grouping controls used for data entry, such as in settings or inspectors.” In fact, we often see it used in iOS settings or in the Health app, where there is data entry, not just tap…