Today we refactored our code to use MVVM and added “unlock with FaceID” to this part of the app.

From Day 72:

Tip: I get lots of questions about why I place my view models into view extensions, […]. This is a small app, but think about how this would look when you have 10 views, or 50 views, or even 500 views. If you use extensions like this, the view model for your current view is always just called ViewModel, and not EditMapLocationViewModel or similar – it’s much shorter, and avoids cluttering up your code with lots of different class names!

Hm, I’m not 100% convinced… #100DaysOfSwiftUI

The iOS Simulator displays a view with a blue button labeled “Unlock Places” and the FaceID interface is shown above the view, indicating it’s being used to unlock the view. The bottom tab bar shows “Day 70” selected in blue and “Day 69” and “Day 68” inactive in gray.

For Day 71, we used Wikipedia’s API to fetch places near a set of coordinates. I had no idea this was a thing, and I already have an existing app idea that I think could leverage this. #100DaysOfSwiftUI

The iOS Simulator displays a “Place details” screen with a title field reading “Windermere Peaks” and a note field with “Take me to the lakes.” Below, a list of nearby locations includes lakes, towns, and landmarks in Cumbria, England.

For Day 70 we added the ability to pin locations on a map and edit them.

We were supposed to use .onLongPressGesture, but I couldn’t get it to work in the previews or simulator, so I just used another .onTapGesture. #100DaysOfSwiftUI

The iOS Simulator displays an Apple Maps view highlighting Windermere Peaks with a red star icon. Nearby locations include Lake District National Park, Windermere, and Kendal. A tab bar at the bottom includes tabs for Day 70 (currently selected), Day 69, and Day 68.

Day 69 was short: we learned how to 1) add different types of maps and 2) use Face ID to unlock the app. #100DaysOfSwiftUI

The iOS Simulator displays an app with three maps of London: one satellite, one with red pins for Buckingham Palace and the Tower of London, and another with blue text labels for those two landmarks. Buttons for Paris and Tokyo are visible between the first and second map. A Face ID prompt overlays the screen and a button indicates the biometrics are currently Locked. A tab bar at the bottom includes tabs for Day 69 and Day 68.

Day 68 has been some of the most interesting content (from a language-learning perspective) in a while.

First, yes the method is just called <, which is the “less than” operator. It’s the job of the method to decide whether one user is “less than” (in a sorting sense) another, so we’re adding functionality to an existing operator. This is called operator overloading, and it can be both a blessing and a curse.

I don’t think I’ve ever worked in a language with operator overloading and it definitely makes me nervous about maintainability. #100DaysOfSwiftUI

The iOS Simulator displays a screen with a list of names in alphabetical order: Kochanski Kristine, Lister David, and Rimmer Arnold. Below the list, a button labeled “Read and Write” is shown, with the word “Loading…” below it.

Day 67 is the last day for this particular project, so we had a review quiz (got 12/12) and added some features to the app without any code prompts, just requirements.

I’m always a little nervous when the challenges are easy… what did I miss? 😅 #100DaysOfSwiftUI

The iOS Simulator displays an app titled Instafilter. A confirmation dialog shows a list of filter options under the heading Instafilter, including Bump Distortion, Crystallize, Droste Effect, Edges, Gaussian Blur, Pixelate, Sepia Tone, Twirl Distortion, Unsharp Mask, and Vignette, with a Cancel button at the bottom.

Back at it after a little Thanksgiving break and we’ve run into our first (I think) need to use @MainActor.

Today we added the ability to change image filters and share the resulting image. #100DaysOfSwiftUI

The iOS Simulator displays an app titled Instafilter. The image of flowers from Day 65 is shown, but this time through a “crystallize” filter. The “Intensity” slider is set to 75% with “Change Filter” and “Share…” buttons below. Underneath is a bottom tab bar with four tabs labeled Day 65–66, Day 64, Day 63, and Day 62, with Day 65 selected.

Day 65 and this sort of thing still gets me:

We can then call that whenever our selectedItem property changes, by attaching an onChange() modifier somewhere in ContentView – it really doesn’t matter where, but attaching it to the PhotosPicker would seem sensible.

We covered modifiers and building our own much earlier in the course, but I still don’t have a good mental model for how/why you can put some of them anywhere and they’ll work. #100DaysOfSwiftUI

The iOS Simulator displays an app titled Instafilter. A sepia-toned image of flowers is shown, with a slider labeled “Intensity” set to 75% with a “Change Filter” button below. Underneath is a bottom tab bar with four tabs labeled Day 65, Day 64, Day 63, and Day 62, with Day 65 selected.

For Day 64 we learned how to use PhotosPicker to… let the user pick photos, use ShareLink to… create share links, and call requestReview() to… request the user leave a review of our app! #100DaysOfSwiftUI

The iOS Simulator displays a screen with links/options in blue text, including “Select a picture,” two “Share…” buttons, “Spread the word about Swift,” “Click to share,” and “Leave a review.” A bottom tab bar shows three tabs labeled Day 64, Day 63, and Day 62, with Day 64 selected.

For Day 63, we learned about the different Image APIs available: Image, UIImage, CGImage, and CIImage. We also tried out ContentUnavailableView!

I continued my normal practice of keeping all the sample code in the project and building UI to see it all. #100DaysOfSwiftUI

The iOS Simulator displays a segmented control with options including sepia, pixellation, crystal, twirl, and dynamic. Below, a “Bro, do you even Swift?” meme (with a picture of Taylor Swift) is displayed with a sepia filter applied. Below the image is a placeholder view with the Swift logo, text that says “No snippets,” a “Create Snippet” button, and a tab bar with Day 63 selected.

For Day 62, I liked that we were shown “Open Quickly” in Xcode and told how to find the definition of a generated interface. I don’t fully understand it now, but I know I will in a couple years.

Oh, and for the start of a new project, we played around with confirmationDialog(). #100DaysOfSwiftUI

The iOS Simulator displays an app with “Hello World” text that is blurred out based on the value of a slider below the text. A red square labeled “Hello, World!” is in the center of the view. A confirmation dialog overlays the screen at the bottom with a prompt to select a color. Options are “Red,” “Green,” “Blue,” and “Cancel.”

Nope, today was the hardest challenge.

I thought it was weird that yesterday’s challenge didn’t require us to use SwiftData (when we had just spent a bunch of days working with it).

Day 61, the other shoe drops—we need to rewrite yesterday’s app to use SwiftData. #100DaysOfSwiftUI


I thought yesterday was our most difficult day so far… now Day 60 has surpassed it.

Today we built an app from scratch with just some requirements to fetch data and build a couple views. Straightforward but a lot of work! #100DaysOfSwiftUI

The iOS Simulator displays a “Friendface” app with the current screen on a user profile view for one of the contacts. The “general info” section includes the contact’s name, age, company, email, and address. Below, an about section contains placeholder text, and a tags section lists terms separated by commas.

Wow, I’m impressed with myself for learning and SwiftData/SwiftUI for being easy.

For Day 59, we had to go back to an old app and upgrade it to use SwiftData, add sorting, and add filtering. It took me about an hour to do everything, which is a lot faster than I expected. #100DaysOfSwiftUI

The iOS Simulator displays an “iExpense” app. The toolbar includes buttons to add new expenses and sort. A segmented control allows the main list of expenses to be sorted by “All,” “Business,” or “Personal” (with Business currently selected). The two listed expenses include “Phone, $34.35” and “Travel, $123.45.”

Day 58: Continuing yesterday’s project and learning about NSPredicate, changing fetch requests dynamically, and creating relationships. One of today’s sections is about syncing SwiftData with CloudKit, but I skipped it because I don’t have a paid developer account (yet)! #100DaysOfSwiftUI

The iOS Simulator shows a Users screen with a sortable list. Names include Ed Sheeran, Johnny English, Piper Chapman, Rosa Diaz, and Roy Kent. Each name has a blue badge (indicating job counts) showing the number zero except Piper Chapman, which shows two.

Starting a new project for Day 57, so don’t have much to show so far. We’re learning how to edit SwiftData objects with SwiftUI and filter data using #Predicate. #100DaysOfSwiftUI

The iOS Simulator displays a list titled Users, showing names Ed Sheeran, Johnny English, Rosa Diaz, and Roy Kent. Each name is in a row with a right-facing arrow, and a plus icon is at the top right for adding users.

Day 56 was a review and challenge (on our own) day, so I updated the detail view to handle missing data more gracefully. #100DaysOfSwiftUI

The iOS Simulator displays a Bookworm app screen showing a book with a forest-themed cover labeled Fantasy. The text says No author. Below is a rating of three out of five stars and a note saved on Nov 16, 2024, at 8:01 PM.

For Day 55 we learned how to delete SwiftData objects, sort queries using SortDescriptor, and add custom buttons to alerts. #100DaysOfSwiftUI

The iOS Simulator displays a confirmation dialog asking, “Delete book. Are you sure?” with options to “Cancel” or “Delete.” The app shows “The Little Prince” by Antoine de Saint-Exupéry, with a fantasy-themed cover image and navigation tabs at the bottom.

For Day 54, we earnestly started the implementation of a “Bookworm” app and created new SwiftData models and SwiftUI components.

I think the only new APIs were .constant() and using .buttonStyle(.plain) to disable the whole “tap the row to trigger its buttons” behavior. #100DaysOfSwiftUI

The iOS Simulator displays an “Add Book” screen with fields for the title “The Little Prince,” author “Antoine de Saint-Exupéry,” genre set to “Fantasy,” a review input containing “Fantastic,” a five-star rating, and a “Save” button.

Day 53 is the start of our first project with SwiftData. So far all the terminology reminds me of my Core Data days. #100DaysOfSwiftUI

The iOS Simulator displays a Classroom app with a list of student names: Ginny Weasley, Ron Lovegood, and Hermione Potter. A header reads “Classroom” with an “Add” button in the top-right. The bottom navigation shows icons labeled Students and Notes.