Page from AI Mastery in SwiftUI

  • Jul 26, 2025

July 26, 2025 BMS Updates

Hello SwiftUI friends,

Just wanted to send a quick update from the road, both in my travels and on the progress of the book!

There's also a super helpful tip if you use AI tools for coding.


🇲🇽 Mexican Adventure Update

Since the last update, I've traveled in Mexico from:
Guadalajara → Morelia → Toluca → and today I'm going to Taxco!

I'm currently in Toluca (just west of Mexico City).

Fun fact: Toluca is the highest city in Mexico at 8,790 feet above sea level.
The air is thin and yes, and it’s cold. ❄️ (50-70 F, 10-20 C)

Mexico Travels

My Plan

For the Summer, I'll be sticking to the higher elevations where it is nice and cool.

(Know of any interesting places to visit? Let me know!)

Then in the Winter, I'll be visiting the beach towns.


📘 Book Progress: AI Mastery in SwiftUI

I just finished a big chapter on something core to building with AI in SwiftUI:
The Language Model Session.

This chapter breaks down:

  • What memory and context mean in AI prompts

  • How single-turn vs. multi-turn sessions work

  • How to initialize and run your own session

  • 8 common reasons why prompts fail (and how to debug and catch these reasons)

  • How to show when a prompt is running — and disable UI while it does

What is a LanguageModelSession?


I'm now deep into coding the rest.

Here’s what’s already in:

Prompt Object

8 SwiftUI code examples
Learn how to collect and send prompt info from the user or from the app (you)

Instructions Object

11 code examples
Teach the model what it should do and how to behave and respond

Generation Options Object

7 code examples
Control levels of creativity, predictability, and length of responses

I'm holding off on writing anything in the book for now because while the FoundationModels framework is still in beta, there have already been changes that forced me to change my code and rewrite parts of the book.

By sticking to just code for now, it'll save time on updates.


🤖 Thoughts on the FoundationModels Framework

So far, here’s what I’ve learned:

  • It’s limited, yes, but that’s expected for on-device AI

  • Biggest use? Not chat, but things like:

    • Text summarization

    • Tagging

    • Info extraction

      Basically, it should do very well at all of these tasks:

      Text tasks

  • Don’t rely on it for “knowledge”, training data is small (in comparison to other models).

  • Haven’t tested tool usage yet (like integration with other apps: Calendar, Reminders, etc.), so more on that soon!


🪄Join the Waitlist

If this sounds like a book you'd be interested in, make sure to join the waitlist to be notified when "AI Mastery in SwiftUI" is available!

AI Mastery in SwiftUI


✨TIP for AI for Coding in the Workplace (or at Home)

This tip will save you a lot of headaches and speed up your coding time.

At work, we have a subscription to GitHub Copilot.

It's not the best as far as integration with Xcode, but it does help. (I use it through Visual Studio Code.)

Recently, I worked to provide instructions that Copilot can use when prompting to make updates, create new files, etc.

These instructions are common now in most AI coding tools. It's usually a Markdown file with a specific name such as: copilot-instructions.md or CLAUDE.md.

They provide essential guidance to AI for maintaining:

  • Consistent coding

  • Best practices

  • Coding standards

  • Architecture, etc.

⭐️ Big Lesson Learned

As I was iterating and testing the instructions, I found that every time it got something wrong (like missing the import SwiftUI, for example), I would add another line to the instructions file.

Then I found that if I just provided an example code snippet, it got it right every time.

👉 Code Example > Numerous Instructions

So if you use a coding tool where you can provide instructions, and AI is messing up, try fixing it with code snippets/examples instead.


That’s it for now! I’ll be sending more updates in the future.

Thank you again for being part of this journey 🙌

Can’t wait to share the full AI Mastery in SwiftUI with you.