Topic

Xcode

A browsable archive of writing and notes across the site.

Post

How to find a Mac app's BundleID

Every iOS and macOS app stores its configuration in a plist file, and the app’s BundleID lives in there alongside the version number. Read the plist and you’ve got …

Post

Method dispatch in Swift

What is method dispatch? Method dispatch is the process by which the program, at runtime, decides which concrete instruction to use when a particular method is called. Dispatch is …

Post

Protocol Extension

Protocol is the most important building block in the Swift ecosystem — the scaffolding that holds everything else together. A few of the obvious wins of using protocols over …

Post

A few notes on LetsMove

When you download a Mac app from the web, it usually ends up in your Downloads folder. But some apps really need to live in /Applications to work properly — self-update being the …

Post

XPC Services

About XPC I’ve been doing some work in this area lately, so here are my notes — a quick recap of what XPC is and how it works. XPC is the umbrella term for inter-process …

Post

Codable && Tuple

While learning Swift, I keep finding interesting things. Codable is one of them. Today, I defined a model with a tuple type, then Xcode gave me an error. The code might look like …

Post

How to generate a NSViewController without a Nib?

Recently, I created all the ViewControllers through the storyboard or the Nib (for views). Today, when I created a demo project without any Nib file, the ViewController did not …

Post

A Swift quiz

A puzzle showed up on Twitter the other day. It exercises overload resolution and type(of:) together. This is just a note for myself; I’ll write up MetaType separately. // …

Post

Libraries and frameworks

Most of us have a rough mental model of what a library and a framework are. This post lays out the basics — not every byte, just enough to be useful. I covered the broader compile …

Post

Build Process

A programming language goes through roughly five stages on its way to a running program, each with its own tool: Preprocessor Compiler Assembler Linker Loader Let’s walk …

Post

Using a C file in a Swift Framework: an exploration

The problem While building a diagnostics tool, we shipped it as a single Pod containing only pure Swift code. The Swift code needed to call into a few system C library features — …

Post

Making a "Send to 2Do" Safari bookmarklet

Drag the link below onto your Favorites Bar. The default click behaviour simulates navigation on the current page, and the destination URL is whatever you put after …

Post

My reading workflow

I’ve been tightening up my reading workflow lately, so here’s an update. The tools involved: DEVONThink Pro PDFExpert MarginNote (1) is the inbox and archive; (3) is …

Post

Testing Swift code that uses system singletons in 3 easy steps

Original: Testing Swift code that uses system singletons in 3 easy steps Original author @johnsundell Most apps built on Apple platforms lean on singleton-based APIs. From …

Post

Avoiding singletons in Swift

Original: Avoiding singletons in Swift Original author & Copyright @johnsundell “I know singletons are bad, but…” — you hear it all the time when developers are …

Post

Different flavors of dependency injection in Swift

Original: Different flavors of dependency injection in Swift Original author & copyright: @johnsundell In previous posts we’ve looked at several ways of using dependency …

Post

What is LLVM

What is LLVM? The secret behind Swift, Rust, Clang, and more Understanding how a compiler emits native machine code makes it dramatically easier to invent a new language or enhance …

Post

In-app purchase

If your app ships on the App Store, in-app purchase (IAP) is something you can’t really avoid. Last year’s spat between WeChat tipping and Apple put IAP in the …

Post

Dependency injection using factories in Swift

Original: Dependency injection using factories in Swift Original author & copyright: @johnsundell Dependency injection is one of the key tools for making code more testable. …

Post

Modularising Xcode projects

Original: Modular Xcode projects Author & Copyright @pepibumur Translator: @OgreMergO Building a modular Xcode project takes a real understanding of project structure and the …