I realize that you might have thought “wow, we’re looking at machine learning already?” After all, this is only day 27 of a 100-day course. But, as Andre Gide said, “you cannot discover new oceans unless you have the courage to lose sight of the shore.”

Heh, #100DaysOfSwiftUI read my mind!

Today we built a UI on top of the Core ML model we trained yesterday. Straightforward but fun!

An iOS simulator displays an app called BetterRest. The user has set a wake-up time of 7:15 AM, a desired sleep duration of 7.5 hours, and a daily coffee intake of 3 cups. A pop-up message shows the calculated ideal bedtime as 10:55 PM, with an OK button below.

I was not expecting “Training a model with Create ML” to be a part of the Day 26 content!

As someone who has built a lot of training content this past year for work, I know how valuable it is to create fun/engaging exercises, so it impresses me to see Machine Learning (ML) in #100DaysOfSwiftUI


Haha this looks so awful, but day 25’s challenge was fun: to build a rock/paper/scissors game from scratch! #100DaysOfSwiftUI

The iOS simulator shows a game with a score of zero. The game is that, given the game’s choice of rock/paper/scissors and text indicating whether the player should pick a winning or losing move, the player then has to select Rock, Paper, or Scissors. The game currently shows “current choice: rock” and “should win” to indicate the player should choose Paper from the buttons below. Icons at the top represent rock, paper, and scissors.

Day 24 was straightforward—a test and a few little changes to make on our own to our recent projects. I had to go back to remember the syntax for custom modifiers. Onward! #100DaysOfSwiftUI


Today I learned that the order of modifiers does matter:

Text("Hello, world!")
    .padding()
    .background(.red)
    .padding()
    .background(.blue)
    .padding()
    .background(.green)
    .padding()
    .background(.yellow)

Day 23 in the books! #100DaysOfSwiftUI

The iOS simulator displays a centered message that says “Hello, world” in white text on a pink rectangle. The pink rectangle is surrounded by a purple border, which is itself surrounded by a blue border.

Day 22 was really easy—added the score counter and a different alert for when the game is “over.” #100DaysOfSwiftUI

The iOS simulator displays a flag quiz game with the title “Guess the Flag.” The prompt says “Tap the flag of Spain.” Three flag options are shown: the Ukrainian flag on top, the Spanish flag in the middle, and the U.S. flag on the bottom. An alert over the flags reads “Correct” with a final score of 8. A “Restart” button is visible.

Day 21 had us building a mini flag-guessing game, but without the score implemented. I will be absolutely shocked, shocked I say when we implement the score as the next day’s challenge. 🇺🇸 🇺🇦 🇪🇸 #100DaysOfSwiftUI

The iOS simulator shows a game titled Guess the Flag. The user is prompted to tap the flag of Spain. Three flags are displayed in a vertical list: the United States flag, the Ukraine flag, and the Spain flag at the bottom. Below the flags, the score reads Score: ???

Day 20 is all about stacks, gradients, buttons, and images. I find it more fun to keep all the sample code in one project and let it pile up. 🤪 #100DaysOfSwiftUI

A screenshot from the iPhone simulator that displays a UI with various buttons and text elements.The screen is absolute chaos. The top shows repeated labels for “First,” “Second,” and “Third.” There are many different linear, radial, and angular gradient backgrounds. Below are colorful buttons labeled “Button 1” through “Button 4,” a red “Tap me” button, and “Edit” buttons. Two “Show Alert” links are at the bottom.


Oh macOS Preview’s signature feature, I love you but this is not acceptable. 😅

The macOS signature capture screen with the “Camera” tab selected. A series of completely erratic squiggly lines is visible above a blue line.

What does the Swift community use for code formatting/linting?

Ideally I’d like to have something that only runs when I invoke it with a keyboard shortcut or maybe on every save.


Day 19, very fun to have a day focused on building a new app from scratch! This was my take on the challenge. #100DaysOfSwiftUI

A unit conversion app running in the iPhone 16 simulator. The screen displays options to convert between Celsius, Fahrenheit, and Kelvin. The conversion is set to convert from Celsius to Fahrenheit, with an input value of 28, resulting in 82.4 displayed as the output. The design is minimal, with a clean white background and simple buttons.

Day 18 is a short quiz and adding some new code on our own without any guidance—it took so little time (9 minutes 😝) that I’m tempted to just start on the next day, but I will resist! #100DaysOfSwiftUI


This definitely trips me up:

Tip: It’s tempting to think that modifier should be attached to the end of the NavigationStack, but it needs to be attached to the end of the Form instead. The reason is that navigation stacks are capable of showing many views as your program runs, so by attaching the title to the thing inside the navigation stack we’re allowing iOS to change titles freely.

I’m not sure I 100% understand the reasoning here… excited to learn more. It’s still only day 17! #100DaysOfSwiftUI


I have a lot to learn about what enables this syntax for two-way binding (note the $):

struct ContentView: View {
    @State private var name = ""

    var body: some View {
        Form {
            TextField("Enter your name", text: $name)
            Text("Hello, world!")
        }
    }
}

Day 16, starting off with creating a new iOS app in Xcode and seeing everything that’s changed since I last used it almost 12 years ago. Hitting Run for the first time… ah it’s so exciting! #100DaysOfSwiftUI


I might not do day 16 tomorrow, we’ll see… running the Long Beach half-marathon in the morning. 😃


Day 15 is a review of the last two weeks of material! #100DaysOfSwiftUI

I kept on going back to the individual pages to find the syntax I needed while working on the tests, so I’m happy to have it all on one page: www.hackingwithswift.com/articles/…


Day 14 is optionals, guards, nil coalescing, optional chaining, and optional try.

Guards are new to me but I like them:

func double(number: Int?) -> Int? {
	guard let number = number else {
		return nil
	}
	return number * 2
}

Two weeks in the books! #100DaysOfSwiftUI


My Series 10 has had really inconsistent battery life (it died on me 8 miles into a run last week 🙃) so I’m happy to see potential fixes in this watchOS update.