« Pre Dub Dub

Functional Swift »

When Apple introduced autolayout in June 2012, they stressed how important it was for internationalization and localization.

I think I remember several examples where they would layout a bunch of UI components in a form and then say something like, "now let's look at it in German."

Once they'd sprinkled in the magic autolayout stuff, everything looked great in English and in German and in any other language you'd want to see.

But in September we saw the introduction of the iPhone 5 which had a different aspect ratio and we all said, "oh. That's why."

In many ways, this changed the way we thought about design on these devices. We weren't designing pixel perfect user interfaces - we were working with a UI that could adapt to different devices in different orientations with different aspect ratios.

Did I say pixels?

We used to specify the size and location of objects displayed in the original iPhone because we knew exactly how many pixels it was across and up and down.

But then Apple told us, "use points not pixels". It was more precise, more standard. It was better.

OK, we said, but we knew there was more to this story.

Sure enough, the next iPhone was a retina display iPhone. If we were still using pixels our interface would look silly and not fill the screen since there were twice as many pixels in each direction.

So that brings me to today.

Last year we saw a ton of new APIs but three got a lot of the headlines: SwiftUI, Combine, and Catalyst.

Actually, before we get to today, let me tell you another story.

Just before Kim died I interviewed for a gig at Apple.

I wasn't sure I was interested as I would have had to move to California and Kim couldn't move yet so we would have commuted each direction on alternate weekends.

That notion seems so quaint now in this time of shutdowns and stay-at-home, but that was our thoughts at the time. She was encouraging me to take the job.

I don't know what the job was - it was one of those secret jobs where Apple doesn't tell you what you're interviewing for.

I'll stipulate two things. First, I still don't know what I was interviewing for or I certainly wouldn't be writing about it. Second, one of the people I interviewed with tells me the following speculation is completely wrong.

I don't care.

This is what I thought it was at the time.

I reasoned that it was clear that Swift did not play nicely with UIKit and AppKit. The existing frameworks used nil with abandon, everything was a reference type, all of the widgets on iOS subclassed UIView or UIViewController and certainly NSObject. I mean, decoding JSON led to a real mess that everyone solved in their own way.

There needed to be a Swift friendly UI type of kit. At that point, I reasoned, iOS and macOS (or as it was known then Mac OS) could unify around the same UI kit.

Oh, while we're at it, we need a more Swift friendly foundation.

At that point, we would have Swift friendly higher level APIs but....

But hadn't Chris and Craig told us when they introduced Swift that they envisioned Swift as being used from everything from applications, to scripting to firmware?

So, I figured, Apple had to be working on a new OS. Something that would play nicely with Swift and something that would allow the transition to ARM.

Remember, I said you could always look back and see that Apple has been telling us things for years - we just didn't know what they mean?

Well look back at the iPhone September events as they announced device after device and called the custom Apple-made ARM chip a "desktop quality chip". Look at how quietly and quickly the iPhone moved to 64 bit ARM chip.

People that are predicting an ARM Mac - duh. Apple's been telling us that's where they're headed for years.

Anyway, I'm told that a Swift friendly OS and UI kit is not what the secret group was working on.

It didn't matter. The job I thought I was interviewing for changed and it didn't make sense for me to accept it. I wouldn't be doing the things I am good at - and Apple could and should hire someone younger and smarter to do the things they needed.

As an aside - thank goodness I said "no". I can't imagine spending the last few months of Kim's life across the country from her.

So back to today - or rather Monday.

I don't think we've seen the full "why"s of Catalyst, SwiftUI, and Combine. I think we've seen some starting points in the same way as we saw the mechanics of autolayout or using points instead of pixels.

It feels like this is the WWDC where Apple shows us how a lot of these pieces fit together to make something bigger.

Then again, I was really wrong four years ago. I could be really wrong again today.