In a previous post, Signing Commits Using GPG on macOS, I explained why it is generally a good idea to sign your Git commits and how to do so. In essence, it’s possible for any user to generate a commit masquerading as another user if the settings for a repository allow unsigned commits.

Since the time of writing of that previous post, GitHub has introduced a couple of changes which enable developers to protect their repositories against commit forgery as part of Branch Protection as well as a new feature called Vigilant Mode which enables developers to protect themselves against…

If you’re not using these, you’re probably writing more code than necessary

Codable is a protocol that was introduced in Swift 4 to make the serialization and deserialization of data into and out of Swift structures a breeze. This post assumes some knowledge of how to use Codable so if you’re unfamiliar with the basics it’s worth reading Encoding and Decoding Custom Types first as a primer. With that being said, let’s continue.

Imagine you have the following JSON you wish to deserialize:

Here’s the series of Swift structures you might write to deserialize the data:

Then using JSONDecoder decode the data as follows:

Very quickly you’ll run into…

Does your QA like to button bash? Here’s a solution.

We’re all familiar with the situation — we’ve implemented the greatest new feature our app has ever seen. It gets to QA and the first thing they do is rapidly bash the button that pushes the next UIViewController five times in a row.

Mechanical switches typically operate using two metallic contacts which when the switch is depressed come into contact within one another thus completing a circuit. These contacts are usually made of a springy metal which may bounce apart from one another once or several times before coming into final contact with one another. This effect can result in…

Make your apps accessible by ensuring that UICollectionViews resize with changes in user text size preference

Dynamic Type is a feature that was introduced in iOS 7 allowing users to change the default font size used across iOS. It is intended predominantly to support visually impaired users but in practice, there are many iOS users who simply prefer a smaller/larger reading size for a variety of reasons.

Over successive releases of iOS, Apple has made numerous improvements to assist developers with the implementation of accessibility features. Each year at WWDC, Apple has held sessions on accessibility improvements and pushed developers to develop more inclusive experiences through the implementation of assistive technologies. For example, apps which have…

The challenges of transitioning users to the latest app update where the need arises

When an emergency arises, it can be beneficial to have a mechanism in place to gently transition users to the latest app update. However, such a mechanism might require a backend solution to let app users know when an update is released which has the potential to be costly both in terms of development overhead and maintenance. Where the choice is between developing such a solution or delivering new functionality to the user, the latter is likely to win out meaning that most apps have little or no means of migrating users should the worst happen.

When it comes to…

Sequencing animation between gradients with varying numbers of colors and more.

I recently created a game called Heartbreaker as an Easter Egg for our app. The game had a gradiented background and whilst at the time of making the game there wasn’t enough time to animate the background gradient, it was a challenge I was keen to return to when done. This article is intended to provide an overview of animating gradients on iOS as well as illustrating some of the challenges encountered along the way.

Protect Your Git Repositories From Commit Forgery Using Signing

If you are a developer using Git as part of your workflow on a regular basis then you’re probably familiar with the concept of using SSH keys to push commits to a remote repository (if you use a URL of the form ssh://) potentially hosted on GitHub, GitLab, Bitbucket etc. Alternatively, you may use a username and password to access your remote repository over HTTPS. Did you know though that whilst your credentials identify you to the remote server (and thus determine the actions you may perform within the remote repo), they do nothing to identify your commits as belonging…

How to implement D-pad style cheat codes in an iOS app

Recently I was thinking about how I would go about implementing an Easter egg within an iOS app and how it could be found by the user. If you’re not familiar with the concept of an Easter egg — an Easter egg is a fun feature hidden within an application that has to be discovered by the user.

In the early days of console gaming it was common for video games to contain cheat codes to unlock Easter eggs or other features of the game such as a level select screen or god mode. Usually these were created by the…

iOS 12 introduced the Network framework including NWPathMonitor, a replacement for Reachability.

I recently wrote an article on how iOS detects captive portals on connecting to new Wi-Fi networks before presenting a web view allowing the user to sign in or register. This is a scenario that will be familiar to most people who have connected to a public Wi-Fi network in a hotel, bar or coffee shop etc. If you aren’t yet familiar with how this works then Solving the Captive Portal Problem on iOS provides a useful background to this article.

Apple’s Reachability sample code has been used as the de facto starting point for detecting network access in third…

Making Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access.

In iOS development, the de facto means of detecting Internet connectivity has been to make use of Apple’s Reachability sample code. However Reachability cannot actually detect whether connectivity is present, only that an interface is available that might allow a connection.

Consider the case of an app user making use of a public Wi-Fi hotspot which requires the user to register or agree to terms of service via a captive portal prior to Internet connectivity being established e.g. at your local Starbucks branch. The device will appear to have connected to a Wi-Fi network but any request for data will…

Ross Butler

Software Engineering Manager @ Go City. All views are my own.

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