Phil's Blog

Verlet Integration for Fluid Spring Animations in Swift

In my previous post, In-Process Animations and Transitions with CADisplayLink, Done Right, I outlined some of the use cases for implementing custom animations, as well as how to use CADisplayLink to help you drive the animations you create. CADisplayLink tells us when to perform updates. However, in that post we

NSAttributedString and AttributedString Bridging Performance on macOS

With the introduction of the Swift-native AttributedString in iOS 15 and macOS 12, it’s become pretty common to convert between the existing NSAttributedString and the new type. Certain first-party frameworks, like SwiftUI and App Intents, require developers to use the new AttributedString. In existing apps, simply moving off of

DocumentGroup Breaks focusedSceneValue Propagation

I have already written about another gnarly bug around document-based apps in SwiftUI in a previous post. In that post, I found that on visionOS, any DocumentGroup scene would duplicate your view hierarchy, causing pretty funny looking visual overlaying glitches. It was most visible on visionOS due to the amount

Conditional SwiftUI View Modifiers are Evil

Custom modifiers in SwiftUI are a great way to reuse code. However, that should never lead to obfuscating semantics. And, unfortunately, most use cases for conditional modifiers do both of those things. Here's why.

Overuse and Misuse of Spacers in SwiftUI Code

When it comes to writing good user interface code, and code in general, it’s not exactly groundbreaking to claim that in any given situation, we should strive to use the right tool for the right job. When working with tools and frameworks that are designed to seem simple on

Phil's Blog © 2026