Not so Swift

When tasked with the job of replacing buggy Swift code with release-quality Objective-C (mostly because I am more familiar with the latter), I find myself wondering why Swift is so popular.

Consider the following pair of code lines. The top line is Objective-C and the line below it is the equivalent operation in Swift (the operation pictured is the common task of pulling some user data from local device storage):

The similarities in the two versions of the operation are highlighted.

When I look at the Swift equivalent, I see a slightly re-arranged version of the operation that was specified in Objective-C.

Hexagonal Buttons

When creating the Musician’s Calculator iPhone app for ToruSound, I wanted the buttons to be more ergonomic and also wanted to be able to render them in patterns that made sense with regard to the underlying science, such as a “circle” of fifths surrounding “triangular” base-10 digit buttons, as well as piano-style buttons for producing actual musical pitches.

The source code for the hexagonal buttons (which is compatible with the Xcode interface designer) is up on GitHub:

https://github.com/DanielLewisRandall/iOpenCalculator/blob/master/OpenCalculator/OpenCalculator/UIHexButton.h

https://github.com/DanielLewisRandall/iOpenCalculator/blob/master/OpenCalculator/OpenCalculator/UIHexButton.m