# 98 - I Almost Lost Patton (My Dog)

Published on

Article Image

Patton is 13 years old now. While he usually displays far more energy and vitality than other dogs his age, various health issues have inevitably emerged as he’s gotten older. Recently, Patton was diagnosed with pulmonary hypertension, and the vet prescribed a targeted treatment plan. Just as I was feeling relieved that the treatment seemed to be working, last Monday afternoon, Patton suddenly couldn’t stand, was drooling excessively, and showed clear signs of cardiac distress.

It was rush hour, and to avoid losing precious treatment time traveling to the specialty hospital, I first took him to the nearest veterinary clinic for emergency care. When we transferred to the cardiac specialty hospital two hours later, Patton was already disoriented and in critical condition. Tuesday night was especially dire—all his vital signs indicated he was about to leave us. Miraculously, through his incredible will to live and the constant calling from my wife and me, he pulled through.

During the six days I spent with him at the veterinary hospital, I constantly recalled every moment of the past thirteen years he’d been with our family, feeling grateful for the wonderful times we’ve shared. Watching him go from bouncing around just the day before to being weak and helpless broke my heart.

The doctors and nurses all praised him as a fighter with extraordinary vitality. On the fourth day of hospitalization, as his consciousness gradually returned, Patton began showing his longing for home, repeatedly letting my wife and me know he wanted to go back. With the doctor’s permission, even though many of his indicators were still far from ideal, I brought him home yesterday. Perhaps the familiar environment gave him extra strength—in just one day at home, many previously stubborn health indicators have been rapidly improving.

Though this episode means my wife and I need to devote much more energy to his daily care, as long as we can be together with him longer, everything is worth it.

Patton, you’re going to get better! Mommy and I love you so very much!

Recent Recommendations

TextKit 2 - The Promised Land

TextKit is Apple’s text layout and rendering framework, providing high-level APIs for developers to handle complex text layouts and interactions. Its goal is to make it easier for iOS and macOS apps to implement text rendering, rich text editing, and high-performance text interactions.

When TextKit 2 was released four years ago, it was hailed as “simpler, faster, and better.” However, in practice it has fallen short of those promises. As the author of STTextView and Notepad.exe, Marcin Krzyżanowski reflects on years of experience and concludes that while TextKit 2’s architecture is elegant, its implementation is lacking—particularly for text editing use cases. He argues that TextKit 2 may not be the ideal tool for building modern text UIs.

In addition, Michael Tsai has compiled related discussions on his blog, which readers may find helpful to join.


Why LLMs Can’t Really Build Software

After trying various large language model products, I’ve consistently felt that LLMs lack a true global perspective in software development—even with the largest context windows. I struggled to articulate why until Conrad Irwin laid it out clearly: effective software engineering depends on an iterative loop, with the engineer’s key skill being the ability to maintain clear mental models.

LLMs can write code, make edits, run tests, and even debug, but they cannot maintain consistent context—making it hard for them to converge on correct solutions. Conrad believes the future of software development will be “humans + agents” working together, but for now, the driver’s seat firmly belongs to humans.


Working with the Main Menu in SwiftUI

Compared to iOS/iPadOS, there are far fewer macOS app developers, which means that even though SwiftUI has long supported window menus, few are truly familiar with it. With iPadOS 26 introducing a macOS-like windowing experience, developers now need to master the relevant APIs to adapt their apps. In this post, Gabriel Theodoropoulos provides a detailed guide to SwiftUI’s main menu APIs.


Hidden Gems in the Swift Argument Parser - Part I

Apple’s open-source library swift-argument-parser greatly simplifies argument parsing when building command-line tools in Swift, but it also includes some lesser-known features. For example, all CLI tools built with Argument Parser come with a built-in —generate-completion-script command to automatically generate completion scripts for Bash, Zsh, and Fish. In this article, Natan Rolnik explains how to use this feature and previews more advanced techniques that will be covered in the next installment.


How to Generate Dynamic Data Structures With Apple Foundation Models

There’s plenty of material on defining static data structures with GenerationSchema, but far less on using DynamicGenerationSchema to support dynamic data structures with Apple Foundation Models. Even the examples shown at WWDC 2026 were overly simplified and didn’t demonstrate the full workflow. Justin Searls uses a cocktail recipe generator as an example to show how to construct a dynamic schema at runtime and parse the results. He also notes that while the API was updated in OS 26 beta 5, the documentation was not—creating potential pitfalls for developers.


Although SwiftUI’s navigation APIs have matured, building an elegant, type-safe, and maintainable routing system in large apps remains a challenge. Wesley Matlock shares a complete architecture: modeling all navigation routes as Hashable + Codable enums, managing navigation state from a single data source, and seamlessly supporting deep linking, state restoration, and debugging tools. A standout feature is the “route chain” design—deep links aren’t just simple jumps but construct the full navigation path, ensuring users always have a clear way back.

Tools

SwiftAgent - An Elegant AI Agent Framework

Even if your app doesn’t yet use Apple’s Foundation Models, it’s hard not to admire the framework’s elegant API design, which showcases the best of Swift. Inspired by this, Dennis Müller created SwiftAgent, an open-source project that brings FoundationModels’ declarative API style to cross-platform AI agent development.

SwiftAgent uses the @Generable macro for type-safe tool definitions, offers zero-configuration agent loops, and supports multiple AI backends (currently including OpenAI). Most impressive is its approach to context management—cleanly separating user input from augmented information and using the ResolvedToolRun enum to provide compile-time type-safe tracking of tool calls. For developers looking to integrate AI agents into Swift apps, SwiftAgent offers a familiar and elegant path forward.

Weekly Swift & SwiftUI highlights!