Sign in

Max Chuquimia
Senior Software Engineer, Electronics Enthusiast, Appreciator of Music

Recently we been migrating our (many) in-house libraries from CocoaPods to Swift Packages. To get an overview of our progress I built a new tool and subsequently learnt a bunch of lessons in something new to me: dynamically loading Swift libraries at runtime!

This is a bit of a longer article, so to whet your appetite here’s a partial list of the things we’ll cover (sometimes in excruciating detail) :

  • 💡 Why I created xcgrapher and how it works

Search for the emoji above to jump to a section!

Here’s what xcgrapher can do for you out-of-the-box

💡Module Migration Mayhem

Here’s a way you can define helper functions in Swift that are injected into your app at runtime for use whilst debugging — no LLDB-esque Python required!

Act I — Setting the scene

Let’s say we are debugging an issue where the focused view has gone missing. In other words, we are looking for any UIView instance whose isFocused property is true. In this scenario, it’s helpful to us to set that view’s background color to a red so that we can easily see where it is on the screen. In the past, I have achieved this by creating a function to recurse through all views in the app, setting background colours where appropriate:

1. func highlightFocusedView(in target: UIView) {
2. target.subviews.forEach {

What if you need to fix an issue caused by an iOS version newer than the Xcode version you are using?

With the release of iOS13 imminent, we’ve found some critical issues that can only be fixed by using new APIs only available via Xcode 11. However our project uses Xcode 10 — building from Xcode 11 introduces even more issues. Of course, we will eventually need to move to the newest IDE, but for now we need a low-risk solution.

The Problem

We have a UINavigationBar with the following appearance traits:


This combination of customization works perfectly on iOS12 and earlier, but on iOS13 the background of the bar appears white (when building from both Xcode 10 and 11).

I recently experienced async/await whilst working in JavaScript. Wouldn’t it be great if we could do the same in Swift!

Here’s what we are going to achieve today, I wouldn’t actually use a ternary operator like this… I just wanted this snippet to fit nicely as the Medium cover image 😅

URLSession provides an asynchronous interface where a closure is called once the abstracted network call has completed. We’re all familiar with this, and it has encouraged us to write our own network layers in a similar fashion. A typical network call might be defined as:

I left a blank line at the end for those of you whose scroll bars don’t hide automatically

Consider a scenario where you need to make multiple API calls, one after another, such as the following:

After login, request the latest Terms and Conditions. If the User has not already accepted them, show the Terms…

I was recently shown FluentValidation, a popular framework for object validation in .NET — I decided to re-write the framework in Swift. It works nicely… but should you use it?

Fluent Validation

Here is the original .NET framework (and here is my version). The idea behind the framework is you can use “fluent” rules to validate the properties of an instance so as to determine whether the entire instance can be considered “valid” or not. Suppose you have a CustomerModel such as:

You can simply import FluentValidation and subclass FluentValidator to build a validator for the CustomerModel. It’s entirely strongly typed, thanks to KeyPath constraining the input values of the rules to valid properties of the generic model. In the end, I think the Swift framework came out even more succinct than…

Recently there’s been an issue with Application Loader where it simply doesn’t allow you to sign in, so I did some poking around and figured out how to bypass the broken UI.

If you’ve tried to upload your app using Application Loader recently you may have encountered the sign-in screen loading briefly and then refusing to budge. There’s a few threads about it around the internet too, for example:

On our QA’s machine it works, but it’s disruptive when we ask him for a moment of his MacBook’s time. So, I went on an adventure into the Application Loader package.

The first thing I did was to launch Application Loader from the command line to see if any logs could give hints as to why it wasn’t working. To do this, I…

Many fellow developers dream of launching our own product, be it big or small. Over the years I’ve had many ideas (that couldn’t be monetized easily) — here’s what I learnt when I finally followed through with one of them.

This article contains some technical language — but anyone who has had involvement with iOS or macOS development in any way will understand what I’m talking about!

Whilst working on an iOS app in Japan I was having trouble translating documentation. I would have to copy Japanese text to my clipboard, open a browser tab with Google Translate and paste the text in — a very disruptive process that often needed to be repeated in quick succession. Sometimes this wasn’t even possible as designs occasionally arrived as images meaning text was uncopyable.

Whenever I run into a problem that’s slowing…

Inevitably, the API you’re developing with isn’t fully functional when the sprint starts or you aren’t given user accounts that cover all the possible cases you need to handle. You could add a breakpoint in Charles and change the response every time… but read on for a better way!

Charles is a powerful tool for inspecting HTTP requests coming from your devices. I’m going to assume you’ve used Charles a bit before reading this article 😉

I’m actually lactose intolerant, but I use Charles anyway

Developers and QA engineers have used Charles to tailor responses to their needs throughout every project I’ve worked on. Breakpoints are the most common way you can mocking responses: add a breakpoint on the request in question and when the response comes back manually modify the payload before allowing Charles to send it to the client device. …

I’ve just returned to Sydney after a three month secondment to Tigerspike’s Tokyo office. This isn’t the first time that Tigerspike have sent me to Japan for work, and I hope it’s not the last.

Tigerspike Tokyo is a highly coveted location for secondment. I’m lucky to have been there from February to April in 2017 for the project Ginza Six and then again from August to October 2018 for another project. I’ve therefore had the privilege of working with many Tigerspikers past and present.

There’s plenty of opportunity to explore Japan on the weekends!

The Routine

Currently there are 20 people in the Tokyo office. It’s a warm friendly environment where everyone knows each other on a level that isn’t possible in a large office.

There are many ideas floating around about how to reduce your UserDefaults/Keychain access code. Here’s a simple and elegant solution I’ve been using.

Here’s a peek at what we’re going to accomplish (don’t worry, the definitions don’t need to be static!)

A good key-value storage solution should have the following features:

  • Strongly-typed access

With the power of generics and ExpressibleByStringLiteral, we can create a solution that doesn’t rely on an enum existing somewhere with a list of keys or a manual list of accessors.

The common denominator of all key-value storage


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store