Matt Gallagher: Cocoa with Love

Articles about Swift, Cocoa, software design and programming.

  • Jun 22, 2017

    Statements, messages and reducers

    I show how to structure programs around three tiers of computational units – statements, messages and reducers – and talk about the general problem of containing and isolating state that this restructuring aims to address.

    app designfundamentals

    Read article

  • Feb 28, 2017

    Looking at Model-View-Controller in Cocoa

    In this article, I’ll look at a little theory and history behind the primary application design pattern used in Cocoa. I’ll discuss the key shortcoming of Cocoa’s Model-View-Controller approach, Apple’s aborted efforts to address this shortcoming and wonder from where the next major improvements will come.

    cocoaapp design

    Read article

  • Feb 26, 2017

    The weirdest subclass I've ever written

    There's an industry-wide push for protocol-oriented programming where shared interfaces, behaviors and substitutability are provided through protocols rather than subclasses. In this article though, I'll look at a case where I chose to use a subclass, instead of a protocol, to take advantage of some specific differences between classes and protocols.

    fundamentals

    Read article

  • Jan 12, 2017

    Compiling a Mac OS 8 application on macOS Sierra

    A light hearted look back at my time programming in the 1990s as I try to get an old Minesweeper implementation of mine from 1999, written in C++ using PowerPlant for Mac OS 8, compiling in Xcode 8 and running on macOS Sierra.

    nostalgiaCarbon

    Read article

  • Dec 27, 2016

    Reference counted releases in Swift

    A discussion about reference counted lifetimes in Swift; how the lifetime of scope variables differs from C++ and Objective-C, how releases are reordered by the Swift compiler and the conventional use of withExtendedLifetime versus my unconventional usage.

    swift

    Read article

  • Nov 28, 2016

    What is reactive programming and why should I use it?

    I'll explain why I consider reactive programming to be one of the most important design patterns for application programming by looking at three scenarios that are common in application development, yet are a drain on development time, lead to frequent bugs and make design and refactoring hard. I'll show how reactive programming addresses the verbosity, eliminates the unsafety and restructures the code to aid maintainability.

    asynchronyreactive-programming

    Read article

  • Nov 28, 2016

    CwlSignal, a library for reactive programming

    In this article, I'm presenting CwlSignal. It is the latest Swift iteration of a library that I've been using for reactive programming for the last few years. CwlSignal is simple, fast, threadsafe and full-featured while offering a number of unique abilities.

    asynchronyreactive-programming

    Read article