When SwiftUI was introduced back in 2019, it came with a fantastic new development tool in the form of Xcode Previews. In 2023, preview support was added for UIKit and AppKit views, and since then Apple has gone on to improve the previewing experience with tools like the #Preview macro, and the @Previewable annotation. However, for as long as this feature has existed, developers have been plagued by one constant source of blockers - preview crashes. Today we will look at how to resolve these so you can get back to developing your UI quickly and easily with Xcode previews. Read more…
Modern app development often requires asynchronous tasks to be triggered, executed in the background, then responded to once the asynchronous task has completed. While async/await has made this a far simpler process in structured environments, sometimes asynchronous jobs have to be handled in an unstructured way via Apple's Task {} API. This interface represents a convenient way to spawn tasks when we do not wish to block the current execution context waiting for the results. However, usage of this API can represent a challenge when trying to unit test our app, resulting in code that is difficult or impossible to test reliably. In this article we will explore ways to banish this unreliability forever by bringing structure to our use of Swift's unstructured concurrency. Read more…
Building apps that adapt gracefully across size classes and devices has for some time relied on UISplitViewController. However, in certain configurations on iOS 26, this can lead to undesirable animations when views are initially laid out when a view controller is pushed on to a navigation stack. In this article, we will discuss the root cause of the issue and how to resolve it. Read more…
See all of my articles.