Skip to content

Hi! 👋 I'm Joseph Duffy. I enjoy building software. This website contains information about my commercial software, open-source projects, and blog posts. Welcome to my corner of the internet!

★ My Favourites

Overamped

Overamped Icon

Overamped is a Safari Extension that redirects AMP and Yandex Turbo pages to their canonical versions, no matter how the page was opened.

Four Squares

Four Squares Icon

Four Squares is a game of memory, skill, and concentration available for iOS, iPadOS, and macOS. Watch what happens each turn and replay what you see.

Hosting DocC Archives


At WWDC21 Apple introduced DocC, a tool for creating archives of Swift documentation that includes the static files required to host a version of the documentation on a website.

In this post I will summarise various methods of serving a DocC archive:

  • Netlify
  • Vapor middleware
  • nginx
  • Apache

All the examples provided here are hosting the DocC archive for VaporDocC, the Vapor middleware I wrote for hosting DocC archives.

Keep Reading

HashableByKeyPath framework release 1.0.0


Today I have released the 1.0.0 version of a Swift package that aids with adding Equatable and Hashable conformance by using KeyPaths.

The package is available on GitHub.

I created the Swift Playground that sparked this concept in December 2018, so this concept has been rattling around in my brain for a couple of years. The API has changed a lot since the original concept, but the core has stayed the same: a protocol that requires a single function to be implemented that uses KeyPaths to synthesise Equatable and/or Hashable conformance.

Keep Reading

Recent Entries

Partial in Swift


Partial is now available in its own Swift package on GitHub. This post is still valid, but somewhat out of date.

Structs are incredibly useful in Swift, especially when representing static read-only data. However, the values of a struct often come from multiple sources, such as view controllers, network requests, and files on disk, which can make the creation of these structs cumbersome.

There are numerous methods to work around this, but each have their downsides. One of these methods is to change the struct to a class and update the properties to vars, but this removes the advantages of read-only structs. Another is to make a "builder" object, but the API of this object must be kept in-sync with the object is wraps.

Partial eliminates these problems by providing a type-safe API for building structs by utilising generics and KeyPaths. Although I learned of the concept of Partial through TypeScript – which [provides Partial as a built-in type][1] – the Swift implementation supports many more use cases.

Keep Reading

Overamped version 1.2.0


Release Notes

Support for the Overamped Install Checker has been added, enabling a method of automatically checking if the Safari Extension is enabled and setup correctly.

The new install checker can be found in the About tab.

Pull request Support watchOS on Quick/Quick


This is a counterpart to https://github.com/Quick/Nimble/pull/916, which added support for watchOS to Nimble.

Note that this is a draft until a new version of Nimble is released with watchOS support. Until then this points at main.

I'm also not sure if the tests will run on CI correctly because the tests require watchOS 7.4 to run and I'm not sure what version of watchOS the simulators are configured with.

I also found that the tests weren't compiling (using Xcode 13.2.1) so I've updated these too.

Don't Use Scope Modifiers with Extensions


Extending types in Swift support setting the scope for the extension, i.e. public, internal, or private, with internal being implicit if nothing is specified.

This may seem useful, but given the following snippet it's impossible to know what the scope of a function is:

func doSomething() {
    // Do the thing
}
Keep Reading