Are You an iOS Ex-Expert?
How Apple announced SwiftUI and took professional developers from Hero-to-Zero in a single keynote session.
Are you an iOS Expert? Superior in Swift? Outstanding in Objective-C? Adept in the arcana of Auto-Layout? A connoisseur in the many and varied intricacies of Collection and Table views? DataSources and Delegates?
If so, then I’m sorry, as your days may well be numbered.
World Wide Developer Conference 2019
It was a typical WWDC, one where Apple introduced many, many, many new features in iOS and tvOS and watchOS. Apple gave the iPad some much needed love, and deemed the result iPadOS.
The Marzipan codename was dropped, revealing Project Catalyst. During the intro, Craig Federighi announced, “One development team, for the first time, can create a single app that spans from the iPhone, to the iPad to the Mac.”
Contrary to expectations, Apple even introduced the new Mac Pro, a processing powerhouse of a computer. Albeit with a price tag to match.
And then, as events were seemingly were drawing to a close, Apple introduced just one more thing..
UIKit, meet SwiftUI
To quote Apple, “SwiftUI is an innovative, exceptionally simple way to build user interfaces across all Apple platforms with the power of Swift.”
SwiftUI uses a declarative syntax so you can simply state what your user interface should do.
SwiftUI can also save developers time by providing several automatic functions including interface layout, Dark Mode, Accessibility, right-to-left language support and internationalization. SwiftUI has native frameworks for Apple Watch, tvOS, and macOS apps, so the methodologies and even much of the code can be cross-platform.
You can preview your work directly in Xcode, and even do-drag-and-drop interface development, with interface components dropped on the design canvas automatically updating your code.
And just like Swift Playgrounds, you can see changes you make in code reflected in real-time.
Think about that for a second.
“The new app development technologies unveiled today make app development faster, easier and more fun for developers, and represent the future of app creation across all Apple platforms,” said Federighi. “SwiftUI truly transforms user interface creation by automating large portions of the process and providing real-time previews of how UI code looks and behaves in-app. We think developers are going to love it.”
And many are not.
The writing was on the wall.
It was obvious this was coming. Google has Jetpack, a declarative framework for creating Android applications.
And then, of course, there’s Flutter, also a Google product, and yet another declarative framework based on Dart which can be used to create Android apps, and iOS apps, and desktop apps, and even has the potential to create web apps, all from a single codebase.
Other developers have provided similar frameworks and libraries like CwlViews. I, myself, had been eying Flutter widgets and its easy, declarative syntax and was a working on a Swift-based version with RxSwift data bindings. (RxSwiftWidgets)
And then came WWDC 2019 and Federighi’s 10-minute intro.
Does this mean that your hard-won UIKit knowledge is worthless? Of course not.
But SwiftUI is going to make writing professional-looking mobile and watch and desktop apps lot easier. I mean a lot easier.
If you’re one of those whose taken the plunge and dabbled with Flutter, you know exactly what I mean.
SwiftUI provides views, controls, and layout structures for declaring your app’s user interface. As mentioned, that code can be shared between apps on multiple platforms with views and controls that adapt to their context and presentation.
And much as Apple did with the Objective-C to Swift transition, Apple’s even allowing you to begin using SwiftUI components and views in existing Swift applications.
Faster, cross-platform code that automatically supports many of Apple’s newest features and UI/UX recommendations?
Friends, if that’s the case there’s going to be a strong incentive to begin using SwiftUI immediately.
And yes, that could easily mean that your hard-won UIKit knowledge is in fact worthless. Or soon will be.
After all, just how much Objective-C code have you written lately?
Ready for Prime Time?
It’s possible that SwiftUI may not be entirely feature complete, and that there may well be things it can’t do… yet.
That said, SwiftUI continues to build on a story that Apple’s been working on since Swift and Swift Playgrounds launched: that everyone can code, and that we need to let our tools do more and more of the work.
Not too long ago, many people asked what benefit lay in learning this new thing named Swift. Wasn’t Objective-C good enough? Did it not do everything that new-fangled language did? And more besides?
And yet…. where are we today?
And it’s true that we, both you and I, have a little time left.
SwiftUI requires iOS 13 as a base and as such, it’s not going to replace everything quite yet.
The Doors Are Open
Regardless, the doors are now open. Developers are going to walk through them. Thousands, if not millions of new developers are going to start with SwiftUI as a base, ignoring what was for what is now.
Using the tools of today to build the apps of the future.
And all of that Auto-Layout arcana? That hard-won knowledge on just how, exactly, to get a UITableView’s headerView to dynamically resize?
So last week. Literally.
New developers, unencumbered by the old ways, are going to embrace SwiftUI. New apps, made with SwiftUI and Flutter and other modern declarative language tools, are going to hit the App Store in dizzying numbers.
And us? We still have existing apps to support. And legacy code to maintain. For now.
So we probably have at least one refresh cycle left.
Technology Marches On
SwiftUI is coming. The advantages are obvious, and the benefits are many.
So it’s up to us to step up, download the new Xcode 11 beta, and dig in. It’s time to lovingly, carefully set aside UIViews and Storyboards and the constraints that once had served us so well, thank them for their service, and — metaphorically speaking — crack open the books once more.
The one thing about computers and technology is that it seemingly advances at light speed. What you know one day may very well be obsolete the next.
A fact that’s both terrifying… and exhilarating.