Well, after 25 year of being a programmer, and around a decade of being an ever more all-in Apple fanboy, I’ve finally allowed those worlds to merge a bit, and I’ve published my first app on the iOS App Store!
Oh, I’ve had many half-baked ideas for apps over the years, but one issue had always been, that I’d never quite learned the specifics of how to do iOS development. I also played a role in a few apps that my teams built over the years, for MMLT and Infoplus, but none of those were ever truly *mine* from start to finish.
Late in 2021 (or was it early 2022?) I worked my way through the really outstanding 100 Days of Swift and 100 Days of Swift UI tutorial series, from the wonderful Paul Hudson‘s excellent hackingwithswift.com site.
(humble brag? I did get through both of those tutorials in well under 100 days… I think that 100 number is meant for if you’re just starting out as a programmer – not a distinguished engineer as myself :lol:)
That eliminated my excuse of not quite knowing *how* to build an iOS App. It left me with just not having an actual app to build, plus the inertia of being “at rest”, meaning I’d never actually built an app from “0 to 1” as they say, and gone through the process to publish it to the App Store.
But over the past few months, I finally had a use case come up that would actually be useful to me, at least on a daily basis, that I think could potentially be slightly useful to others, and that was of a scope that I knew I could tackle at this point in my life.
I’ll avoid the gritty details of “why” this need exists, but suffice it to say that, virtually every day I am asked to perform a time-based calculation, which generally takes the form of:
- Point-A to Point-B = Interval-C
- Interval-D minus Interval-C = Interval-E
- Point-C plus Interval-E = Point-D (which is our desired answer)
For example:
- 11:47 to 12:26 = 39 minutes
- 4 hours minus 39 minutes = 3 hours 21 minutes
- 1:18 plus 3 hours 21 minutes = 4:39. QED.
It’s not fun to do that math in your head (heck, for me, it’s barely possible!). It’s a little easier to do on paper, but then, who has that much paper just lying around? I’d like to do it on my Mac or iPhone, but what app do you use for that? Doing it in a regular calculator app is just about the same as doing it in your head, thanks to all the number-bases and intermediary values. So I searched the App Store for Time Calculator apps, and let’s just say that none of the results were satisfactory for me.
Therefore, as a programmer, I wanted to solve the problem by writing some code. And having recently completed the Swift tutorials mentioned above, I was ready to build my own app. The pieces were starting to line up for something good!
So I wrote some code! It was lots of fun, and I think I took an okay approach, both in terms of the structure of my Swift and SwiftUI code – several discrete views, a completely isolated model – unit tests on the models, and a heavy dose of Swift enums, that I used to implement a finite state machine, to manage the parsing of user-keyed time equations, as well as the enabling and disabling of all buttons on the calculator screen.
Wait, at this point, I should probably show what the app looks like. So, here are some screenshots!
The last problem to overcome was one of the two Hard Problems™ in Computer Science: choosing a name (the other hard problems in CS being cache invalidation and off-by-1 errors). I won’t say I’m “proud” of what I ended up with, but I can at least say that it’s fun, and, by golly, I like fun things.
So my first App published on the App Store is officially named: Whenr Whenr
(to be me, and explain the thing that’s probably obvious… that name is based on the word “when”, but with an awkward ‘r’ appended onto the end, to ape a certain style. then it’s supposed to sound like “winner winner”, which reminds me of the fun expression “winner winner, chicken dinner“. ok, explanation time over, back to the blog)
There you have it. A rough tale about my first iOS App. Of course I’ve got a long backlog of things I might add to it some day:
- Support for seconds and/or decimals
- Support for Dates and Date/Times
- Date and/or Time pickers (the standard iOS widgets for choosing, rather than keying the values)
- Saving the Ledger; having multiple Ledgers; exporting the Ledger, naming and time stamping entries in the Ledger – lots of Ledger work.
- Widgets… yeah, it should have widgets. And shortcut support – not sure how, but somehow. Oh, and to keep up with the times, Live Activity / Dynamic Island support! Heck, if it was just spinning the icon, that’d probably be sufficient!
- Starting a timer (e.g., from the Clock app) from an Interval in the app.
But – I decided to finally “shoot the engineer and ship the app” today. Which meant I got to spend a whole lot of time making lots of images for App Store Connect… Not too much fun, but a nice change of pace I guess.
Oh, I should probably provide a link to Whenr Whenr on the App Store. It’s available for iOS, iPadOS, and macOS (for Macs running Apple Silicon, as it’s just the iPad version).