Stagehand

This page contains in-depth technical details on the underlying technologies that Stagehand uses. This information won’t be interesting to many, but the few to whom it will be, here it is.

Stagehand is an iOS application built using a combination of Swift and Objective-C, as well as a mix of custom UI components and standard UIKit components. Stagehand has been reworked from the ground up several times over its decade life, from being an HTML5 app to the modern application it is today.

March 2020 – v2.1
The library of colors was, from v1.0 for iPhone until now, a Property List file containing entries for each color Stagehand shows. While the collection has grown, and we transitioned from XML-based to a Binary Property List, the data storage stayed relatively the same since the beginning. That changed in the release when we reencoded all of the color data in a now-ubiquitous JSON plain text file. Data is now loaded directly to a Swift struct using the Codable protocol, which assists in the seamless deserializing of data into the application. Additionally, we store about half as much information about each color than we did previously, instead opting to dynamically computer things like the hue, saturation, and brightness of each color, which can be easily derived from the existing red, green, and blue values we keep.

In addition to changing the way we store the library of colors, we completely reworked how search and filtering works under the hood to greatly improve the performance of searches. While searches did not take a noticeable amount of time in previous versions, they are now technically 10x faster as we have opted to use the native sorting functionality of Arrays in Swift, where previously we copied the library into Objective-C style NSMutableArray objects, performed the filtering, and copied the results back to native Swift Arrays. We’ve made a similar change in how we dynamical sort colors for display, including the hue sorting you see when you launch Stagehand as well as the brand-specific sorting to match the manufacture’s swatch book layouts.

September 2017 – v2.0
Beginning in the summer of 2017, Stagehand received a complete rewrite which saw a majority of the application rewritten in Swift. The goals of this update were to finally support the most recent screen size additions in the Apple ecosystem of mobile devices, to modernize the codebase, and to keep me awake while I sat outside overnight at the Wolftrap National Park for the Performing Arts as we teched that summer’s production of Puccini’s Tosca. (There really is something wonderful about sitting exposed to the outside, rain pouring down, and teching an opera, but by 3am with nothing to immediately do, you find yourself looking for a reprieve.)

One of the inspirations for the new sliding drawer that appears when you select a color was Apple’s own Maps application. It was a tricky component to write, but the foley of developer is to write your own, only to realize someone has written a better, more complete, implementation. So we used their open-source alternative. One of the key reasons we wanted a component like this was purely aesthetic. The translucency allows similar colors to peek through, helping keep context of where you are, even when you look at specific colors.