Peter Steinberger

Latest Posts

The State of SwiftUI

Is SwiftUI ready for production in iOS 14 and macOS Big Sur? I take Apple's Fruta sample app for a test drive to find out. Diving into performance bottlenecks, AttributeGraph crashes, and platform-specific issues, I provide a realistic assessment of SwiftUI's current state. While there are significant improvements since last year, some rough edges remain that developers should be aware of before going all-in on this promising technology.

Logging in Swift

Dive deep into Apple's unified logging system with the new Swift Logger API introduced in iOS 14. I explore the benefits of OSLog's categorization, privacy features, and performance advantages while examining why most developers don't use it: the inability to access logs programmatically. Learn about the promising new OSLogStore API that Apple initially included but then removed from iOS 14 at the last minute, my investigation into private APIs for log streaming, and techniques for enabling debug mode. This comprehensive guide tracks the evolution of Apple's logging system and provides practical code examples for implementing effective logging in your Swift applications.

Building with Swift Trunk Development Snapshots

Dive into my adventure of building PSPDFKit with the Swift trunk development snapshot. I document the various compilation errors, linker issues, and debugging challenges I encountered, sharing solutions for each roadblock. Whether you're preparing for a new Xcode release or just curious about bleeding-edge Swift, this troubleshooting guide will help you navigate the sometimes bumpy road of working with Swift's development branch.

Calling Super at Runtime in Swift

Join me on a deep dive into Swift's runtime as I tackle a seemingly simple problem: implementing a dynamic super call. I explore Swift's object model, discover obscure linker flags, and tinker with assembly language to solve this challenge. You'll learn how Swift methods are represented at runtime, why this problem is particularly tricky, and the surprising solution involving ARM64 registers and the Swift runtime's internals.

zld — A Faster Version of Apple's Linker

Accelerate your iOS build times by up to 40% with zld, a drop-in replacement for Apple's standard linker. I explain how to integrate this optimized linker into your project workflow, including strategies for monorepos and compatibility with Mac Catalyst. My practical guide covers installation via Homebrew, creating a conditional wrapper script that gracefully falls back to Apple's linker when needed, and configuring your Xcode project with the proper build settings. Learn how this simple change can save precious development time by significantly reducing linking duration.

How to Fix LLDB: Couldn't IRGen Expression

Solve the mysterious 'Couldn't IRGen expression, no additional error' issue in LLDB when integrating Swift frameworks into your iOS app. I investigate why our customers couldn't use the debugger after adding PSPDFKit, analyzing how Swift modules store absolute paths in binaries, and how this breaks debugging on different machines. Learn why mixed Objective-C/Swift projects work while pure Swift ones fail, how the Swift trunk snapshot offers better diagnostics, and discover the surprising solution: removing dSYM bundles next to your framework. This deep-dive explains compiler flags like -no-serialize-debugging-options and covers essential troubleshooting techniques.

Updating macOS on a Hackintosh

Follow my step-by-step process for safely updating macOS on a custom-built Hackintosh system. I walk through updating OpenCore bootloader and essential kexts before attempting the macOS 10.15.5 upgrade, explaining how to create a bootable USB drive for testing, carefully update the complex config.plist file, and verify your system's compatibility. This practical guide includes tips for using tools like OCConfigCompare, upgrading to newer versions of AppleALC, Lilu, WhateverGreen, and other critical components, plus real-world insights from someone who balances Hackintosh use alongside genuine Apple hardware.

InterposeKit — Elegant Swizzling in Swift

Introducing InterposeKit, my weekend project for elegant method swizzling in Swift. This modern library leverages Swift 5.2's callAsFunction and makes it easy to hook into Objective-C methods with clean, type-safe code. I explore the challenges and solutions encountered while building it, from dealing with dynamic class loading to crafting a Swift-friendly API for method interception. Learn how InterposeKit improves upon traditional Objective-C swizzling techniques while maintaining compatibility with Swift's strong type system, and see how it can be used to fix real-world bugs like the Mac Catalyst text input crash.

The Great Mac Catalyst Text Input Crash Hunt

Investigate a persistent crash in Mac Catalyst apps' text input system affecting macOS 10.15.4. Through runtime inspection and disassembly, I identify a race condition in Apple's RemoteTextInput framework where the documentState property is accessed from both the main thread and XPC background threads without proper synchronization. My deep-dive analysis explains how to detect this threading issue using conditional breakpoints, examine the call stack with Hopper, and implement a clean solution with os_unfair_lock to make the property access thread-safe. This article offers both technical insights into UIKit/AppKit bridging and a practical fix for developers experiencing the same problem.

Jailbreaking for iOS Developers

Discover the valuable world of iOS jailbreaking from a developer's perspective. I explore the wide range of capabilities unlocked by jailbreaking, from security research and debugging tools like FLEX to enhancing accessibility and examining how apps work internally. This guide covers the legality of jailbreaking, current jailbreak options like checkra1n and unc0ver, and practical applications beyond just pirating apps. Learn how to use tools like SSL Kill Switch to inspect network traffic, examine view hierarchies of third-party apps, and access powerful development capabilities that make jailbreaking a uniquely valuable tool for iOS developers.