Apple Actually Kept a Secret

Apple Actually Kept a Secret

Tech News apple ios objective-c swift wwdc

Every year around this time the rumor mill goes into overdrive about WWDC, and every year I roll my eyes a little because most of it is just spec-sheet guessing about whatever iPhone is coming in the fall. Screen sizes, chip names, maybe a gold color option nobody asked for. Yesterday's keynote in San Francisco was different though, and not because of anything you could've guessed from a leaked schematic.

Apple announced a brand new programming language. Not a feature. Not a version bump. An entire language, built from scratch, sitting right next to Objective-C in Xcode like it had always been there. It's called Swift, and as far as I can tell almost nobody outside Apple knew it existed until Craig Federighi typed a few lines into a "playground" panel on stage and the results just appeared next to the code, live, no build step, no waiting around.

That part actually got me. I've spent enough hours poking at iOS side projects to know the usual rhythm: write some Objective-C, hit build, wait, squint at a crash log, repeat. The bracket message syntax alone always felt like it was fighting me instead of helping me. Watching code update instantly as you type, with actual inline results next to each line, made a five minute demo video feel like it was showing me something I'd wanted for years without knowing it.

What I'm more interested in, honestly, is how quiet this whole thing stayed beforehand. Apple leaks like a sieve most years. We've known about bigger phones and health sensors and home automation stuff for months, thanks to random supply chain photos and "sources familiar with the matter." A brand new language, with its own free book on the iBooks Store the same afternoon, didn't leak at all. Not a whisper. Somebody there can clearly keep a room full of engineers quiet when it matters, which is honestly more impressive to me than any syntax decision.

Not that the syntax is bad. Type inference, optionals baked into the type system instead of bolted on with nil checks everywhere, no semicolons required (though you can still type them, which is a nice mercy for people who can't break the habit). It reads a lot closer to Python or Ruby than the C ancestry Objective-C never really shook off. Whether that matters for actual app performance is a separate question I don't have an answer to yet, and I'm suspicious of anyone who claims they do after watching one keynote.

There was plenty else in the two hour keynote too. OS X Yosemite got a genuinely big visual overhaul, flatter and lighter, and there's a "Continuity" feature that's supposed to let you start a text on your Mac and finish it on your phone, or take a phone call through your laptop. Sounds nice in theory. I'll believe it works reliably outside a stage demo when I see it on my own five year old MacBook. iOS 8 is finally getting widgets in the notification center, years after Android had them, plus a health tracking framework every fitness app is presumably scrambling to hook into this week.

Swift's the one I'm actually going to spend a weekend on, though. I already grabbed the Xcode 6 beta, which is a chunky download if your connection is anything like mine on a Tuesday afternoon, and I'm planning to port one of my smaller side projects over just to see how much of the Objective-C boilerplate actually disappears. My guess is a lot of it. My other guess is I'll hit some wall by Sunday night involving a framework that hasn't caught up to the new bridging yet, because that's how these things always go the first week with anything this new.

If you write any iOS code at all, go watch the playground demo before you read anyone's hot take on it, mine included. It's a better argument for the thing than any paragraph is going to be.