Catalytic Converter

Catalyst is in some ways a miraculous technology – just click a check box and instantly have a working Mac version of your app. And, given the source code of a relatively modern iOS app, it certainly works. Even PCalc’s About screen worked out of the box.

“Your developers were so preoccupied with whether or not they could that they didn’t stop to think if they should.”

But that is just step one of a much longer process.

I wanted to explore how feasible it would be to move PCalc to Catalyst, but my criteria was that I would only release something that was better than the existing Mac version. It would be great if I could. Even though a lot of core logic code is shared between the different versions, most of the user interface code isn’t, so I currently have to write that twice which means less time spent on both versions.

For a developer without an existing Mac app, that equation is certainly a different one.

The “single check box” Catalyst version of PCalc is a single resizable window, with many tables and popovers that seem to me to be out-of-place on the Mac.

It does all work though!

Things that work well with touch, don’t necessarily look or feel great. In fact, I would say that the more an app uses the standard iOS user interface elements, the less it feels right on the Mac.

For something like a game that is all custom UI anyway, you probably couldn’t even tell, although Catalyst currently isn’t a great fit for game developers either.

It became pretty clear to me that I would need to rewrite a lot of the user interface, to find a happy middle ground between the iPad and the Mac. Which would probably benefit both in the long run, to be fair. But with everything else that was going on this summer, I couldn’t justify that work, with no guarantees at the end of the day that I would have something I was happy to ship. So, I mainly focused my time on things like Shortcuts and Dark Mode, and iOS 13 support in general.

I decided I would commit to a Catalyst version of my “Dice by PCalc” app. It’s a smaller app, and not so high stakes, but it still touches a lot of the OS. That would give me a feel for how well Catalyst works today.

Time to roll the dice…

And I have something that is functional, that I shipped on day one. I’m still not 100% happy with it yet though.

Once you get past that first check box, and want to build out Mac-specific features like menus, the APIs start to feel rougher and unfinished. For example, the ability to put images in menus only started working late in the Catalina beta cycle, and the menu APIs are not nearly as comprehensive as the underlying Mac equivalents.

SceneKit fails entirely on older machines with Nvidia GPUs, leading to black windows, a bug that made it all the way to Catalina GM. Multiple window support works, but I ran into a lot of problems there too. Some APIs like the share sheet are just not present.

There’s still no direct way to read the state of the keyboard either, so detecting that the user is holding down option as you drag something isn’t easy. That also affects games that want to offer keyboard controls. I found a way through public APIs, and App Review did approve the app using this technique, but it isn’t ideal by any means. Similarly for really simple things like changing the cursor.

Some user interface elements like the spinning carousel pickers felt especially out-of-place, and unintuitive – you can’t click and drag on them to change the value, you have to use a scroll wheel/gesture.

Before polishing

The nearest equivalent on the Mac would be something like a popup menu button. But there’s no popup menu button on iOS, so I have resorted to writing my own – and that is one of the classic blunders.

After polishing

It’s the kind of thing that Apple should supply as standard, but I get the feeling they just ran out of time. The OS releases don’t seem to have gone very smoothly in general, from my outside perspective.

Documentation for Catalyst has been almost non-existent too, which has made things a lot harder than they should be.

From the business side, there is also no way for somebody to get the Catalyst version of the app for free when they buy the iOS version. And no great way to share in-app purchases either if you have a free app. That generally means that somebody will have to pay a second time to get a copy. There is definitely an argument that building a Catalyst version is actual work, work that should be paid for, but I can equally see the side of consumers that have been told it’s just a simple check box. Apple said a shared store will come in two years, but that’s still a way off.

I am hopeful that this is just a 1.0 (if you count the Mojave apps as a public beta), and things will continue to improve. It’s a great foundation, but there’s still a way to go before I could use it for PCalc. The real question is, what will be the state of Catalyst vs the state of Swift UI in future years? If one gains significant traction with developers, will Apple stop investing resources in the other? Time will tell.

For now, buy my Dice app ūüôā

Record Breakers

I’m impressed, PCalc 1.4 and PCalc Lite 1.4 were approved and available in about two and a half days from submission to the App Store. That’s the fastest I’ve seen so far – I submitted them late on Tuesday afternoon and they were both up there as of 3am Friday. Within two minutes of each other too, which is new.

I’ve updated the metadata on the apps so they should change release date to today when the store next pushes an update out to its servers – it usually takes an hour or two. I also changed the copyright strings to say ¬†2009 – don’t forget that folks.

I wonder if updates to apps get the same level of¬†scrutiny¬†as new ones? I’d like to believe that someone out there somewhere in Cupertino has been assigned to my account and always reviews the same apps when they update. I suspect though, that they are just randomly assigned to whoever is free in the queue. Things are definitely getting faster though, but I don’t know if that’s just down to throwing more people at the problem, or improved procedures. Anyway, thank you mystery app store reviewer(s).

Both apps now sport a splashscreen, something that was previously frowned upon by The Powers That Be.

I thought I’d put a toe in the unknown waters of Apple guidelines and see if it was accepted, and it was. I’ve seen lots of apps that use one nowadays and it makes a lot of sense for PCalc anyway. The calculator themes and layouts meant you usually ended up with a jarring change of appearance after the app launched.

The initial display for an iPhone app is just a fixed picture while the actual code is loaded in the background. It’s meant to give the impression that the app has launched faster than it has, but more often than not it has the opposite effect and also makes the user think they can click on things before they really can.

I was also vaguely concerned by a new UI feature I added for 1.4.

PCalc now keeps track of the conversions (and constants) you use, and displays the most recently used at the top of each section. The idea is that you save a lot of taps if you use the same conversions frequently. I already had the code for tracking recent selections from¬†desktop PCalc¬†but it wasn’t wired up to any UI in the phone version.

Anyway, one of the features in the Mac version is a button that swaps the most recently used conversion round, so if you just did “Feet to Inches”, it would switch to be “Inches to Feet”. I wanted that in the phone version too, but it was tricky to find a good place to put it. Initially I just added a “Swap” button at the top left of the top level of the Conversions section. That worked, but I extended the feature to also show recent activity one level down in the individual categories. The top left position shows the back button in that case, so there was no room for the swap button.

The best place I could find was the right side of the cell that displays the conversion, so I needed a button.

I thought that the button you get for showing more information about an item was a good model – like you see¬†in the network section of Settings.app.¬†If you tap the button, something different happens than if you tap on the rest of the cell. There wasn’t anything appropriate provided by the system though, so I made a custom button, and painstakingly recreated something in Photoshop that was “in the style of” the system buttons but with a different symbol on it.

I really like trying to recreate iPhone and Mac UI elements in Photoshop. Most of them probably were made in Photoshop originally, so it’s fun to figure out how they implemented certain effects.

So, that’s my swap button – tap it, and it reverses the displayed conversion. You can then tap the cell to perform it.

I’d heard rumblings that Apple was cracking down on “non-standard” iPhone UI and not approving some apps because of it, so was worried this would qualify. But it was passed by the censors – either because they thought it was suitably Apple-like, or maybe they just didn’t notice. I hope the former!

Anyway, while I’ve been typing, the PCalc release dates have updated, even if the apps haven’t hit the front page yet. There seems to be a lot of caching in the App Store servers, so it can take a while for changes to be reflected everywhere – the iPhone store often shows different things to the iTunes one.

Ok, I’m off to do some product launch PR, hope you like the new releases!