Blog

I mainly write about my professional endeavours with Swift, Objective-C, Xcode and the Apple technologies. Those take place in a corporate environment in which we design, develop and deliver apps for all major platforms (including Windows and Android) and multiple customers. Our apps are native and brandable clients for our cloud solutions targeted at hosters and telecommunication companies. My personal focus is set on native apps for macOS.

How to Automatically Connect Debugger to Extension and App

There is a convenient way to automatically connect the debugger in Xcode to a file provider extension and its host app process on run.

Broken Pipe in Gitlab With xcpretty

The constellation of GitLab CI, xcodebuild and xcpretty may result in an odd error and job failure. The missing piece to success is an environment variable.

Injecting Dependencies with a simple Annotation

Sometimes I would have liked to have dependencies injected in an easier way which reduces boilerplate code. After fiddling around with generics I finally found a satisfying pattern.

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.

Restore Clean NSFileProviderReplicatedExtension Environment

While developing and porting macOS file provider extensions based on NSFileProviderReplicatedExtension I sometimes ended up in a messed up state of my environment. I found these steps to restore a clean environment again.

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.

Resetting a Privacy Choice on macOS

macOS shows a privacy choice prompt for certain aspects like the address book only when an app requests access the first time. This simple terminal command erases the saved choice.

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.