These pages use the taxonomy term "Swift".

How I Test Functions Which Dispatch Tasks

Some functions dispatch tasks or code blocks to a different dispatch queue. I have wrapped the wait for that asynchronous code in an extension to XCTestCase.

How I Test View Controllers

By example I want to show how I instantiate and test view controllers from a storyboard in a macOS app using the conventional MVC pattern and AppKit.

How to write a Swift Mock Code Generator in Swift

Incontent with the Swift mocking solutions available I thought about how to write a mock code generator for Swift by myself. Getting started is surprisingly easy with Swift packages like Swift Argument Parser and SwiftSyntax.

How to manage Login Items in Swift

There is a Mac App Store and Sandbox compatible method to implement automatic launch on login. Checking the enablement status before macOS 13 Ventura is a bit tricky, though.

Passing Build Settings Into Property Lists

An app which is customizable for different brands and customers also requires a parameterized build configuration. Some values need to be accessible during runtime, too, while retaining a single source of truth. This is more elegant take on what could have been achieved with preprocessor macros in Objective-C times.

macOS Preferences Window with Storyboards

Recently I started with a fresh project from scratch in which I wanted to implement a preferences window with tool bar tabs as they are common on macOS. It is surprisingly easy.

Exporting Unified Logging System Messages with OSLog

Logs are useless, if you cannot access them. The introduction of the OSLog framework finally makes it possible to extract logs from the unified logging system. This is how.

A macOS App with a File Provider Extension

To me it was not obvious on how to get started with the file provider API on macOS. I want to share how I successfully set up an Xcode project for development.

Manually Signing Embedded Swift Runtime

Sometimes the Swift runtime ends up in a built product as well and needs to be (re)signed just like the rest.