Topic

Closure

A browsable archive of writing and notes across the site.

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

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 …

Post

Handling non-optional optionals in Swift

Original: Handling non-optional optionals in Swift Original author & copyright @johnsundell Optionals are arguably one of the most important features of Swift, and one of the …

Post

Understanding responders and the responder chain

Apps receive and handle events through responder objects. A responder is an instance of the UIResponder class — and UIView, UIViewController, and UIApplication, all the usual …

Post

Capturing objects in Swift closures

Original: Capturing objects in Swift closures Original author @johnsundell Ever since blocks were introduced to Objective-C in iOS 4, they’ve been a core part of the most …