A minimal reachability check for Swift
Published 20 November 2022
Published 20 November 2022
A dive into the lifecycle of @StateObject objects, and what causes them to be created and destroyed.
Published 3 January 2022
A terrible Swift package for converting HTML into Markdown.
Published 21 December 2021
I have a dilemma; the Swift enum is a first-class type and, if we're to obey the laws of encapsulation, an enum type should own its functionality. But can we do this in a nice way, when its behaviour is different for each value in the enum?
Published 27 July 2019
In 2015, I tried to write a mocking framework for Swift. It was over-engineered, difficult to use, and quickly abandoned. This article introduces a much better re-write.
Published 21 December 2018
I have a confession to make: I've been writing code for 35 years, but still need to count on my fingers when coding an array range-check.
Published 2 December 2018
I've come to the conclusion that using Swift extensions to make types conform to protocols is rather an anti-pattern. Let me explain why.
Published 23 November 2018
Apple's documentation about the NCWidgetProviding protocol, and widgetPerformUpdate: function in particular are rather sparse, and most posts on StackOverflow seem to have a very simplistic view about how this callback should be coded. So here are my tips.
Published 10 November 2018
I'm rewriting Nearly Departed, and working on a large iOS project in my day-job. While working on both of those projects, I've started to rely on two unofficial rules for enumerations.
Published 3 November 2018