Swift, the language Apple launched as a dead-simple alternative to Objective-C, has become quite robust. Swift is also core to Apple’s main objective for its various platforms: unified apps and services.
Today, Apple has five distinct platforms: iOS, iPadOS, macOS, watchOS, and tvOS. If the rumor mill churns out some truth, it may soon be joined by a sixth, dubbed ‘rOS,’ aimed at augmented (and maybe virtual) reality.
Apple’s latest efforts with Swift and its developer community have centered on bridging the gap between those various platforms with simpler design, development, and distribution options. The most notable of these efforts, Catalyst, allows developers to write a single iPadOS app and deploy it to the Mac. SwiftUI is Apple’s stab at a proper framework for designing and developing simple apps and user interfaces.
None of what Apple has done so far encompasses all its platforms. But it’s easy to see how each step forward and tool introduced could bring that unified vision to life. A simple ‘flip of the switch’ could bring iOS apps to the Mac via Catalyst, for example. It’s clearly Apple’s long-term goal—but is it possible? Microsoft failed miserably at its Unified Windows Platform, after all.
Rather than speculate, we asked experts for their take on how Swift is (or isn’t) helping Apple achieve a more unified platform.
Swift is Already Cross-Platform
Dawid Karczewski, CTO at Ideamotive, thinks Apple’s support matters:
Swift is a first-party Apple technology, so it'll always have first-class support. Developers can write an app in Swift for every piece of Apple hardware, spanning across not only notebooks and desktops, but also watches, TV boxes, smartphones, and tablets. There's simply no better technology available for Apple devices. Xcode and Swift support every new Apple device from day 0, including new M1 Macs.
Karczewski’s comments underscore Apple’s first step in its process: making Swift available to all platforms and supporting it directly in Xcode. Though you can’t quite port a watchOS app directly to Apple TV yet, Apple’s support and dedication to Swift as its next-gen language is significant. Because Swift is available for all Apple platforms, creating an app with centrally supported libraries and frameworks for myriad platforms is far easier.
Catalyst is the… Well, Catalyst
As naming conventions go, Catalyst is a bit on-the-nose, but it fits because it was the catalyst for the death of an old Apple development platform.
With Catalyst, developers are able to take an iPadOS app and click a few items in Xcode to make it available to macOS. (Of course, that’s an oversimplification, because some apps will require more tooling, but it really is that easy for many apps.)
As we mentioned in 2019 when Catalyst launched at WWDC, Catalyst is killing AppKit, the long-standing development platform for macOS. This was step two in Apple’s process: Knock down significant internal barriers to a future for cross-platform apps.
Adam Fingerman, CEO at ArcTouch, tells Dice: “We believe the Catalyst project is a great initiative. Historically speaking, building apps for the Mac has always required very specific knowledge of the design patterns that were specific for that platform. Many iOS developers were not versed in macOS development—as they were originally attracted to the Apple platforms through their iPhone, and not their Mac.
“With Catalyst, Apple opened up a door for iOS engineers throughout the world to build apps following iOS patterns into the Mac with one consolidated codebase developed in Swift. This simplifies the development process and creates more financial opportunities to support the Mac with their products, with minimal investment. We expect many apps that were previously iOS-only to be made available on the Mac.”
Karczewski adds: “It's not perfect, but it allows running iPadOS apps on macOS desktops and notebooks. It basically means that, by using Swift, you don't even have to write separate apps for each device, you can write one app that covers almost every Apple device made and will run well on iOS, iPadOS, macOS, and tvOS. Only watchOS needs a different approach, but it's quite understandable due to how small the watch screen is. Furthermore, new M1 Macs allow running native iOS apps that don't use Catalyst.”
(We should note Apple’s support of iOS apps on Mac is, to date, unclear. Some have been successful sideloading iPhone apps to M1 Macs, but Apple’s official stance is the Mac will only run iPadOS apps. Speculation is that WWDC 2021 will see Catalyst opened up to iOS apps.)
Go Outside the Walled Garden
When considering the digital world at-large, Apple’s slice of the pie is thin. To engage more interest and support, Swift has to venture outside its sandbox—even beyond the confines of Apple’s famed “walled garden.”
This is step three in Apple’s process: let others play with Swift. In 2020, Bear Cahill, Lead Mobile Developer and President at Brainwash, pointed out to Dice: “Despite being open-source and cross-platform, Swift doesn’t have a well-known presence nor many supported IDEs.” Indeed, popular IDEs like VSCode don’t officially or directly support Swift. Swift is still very “Apple” in nature.
But Swift now supports both Linux and Windows, which should help. Fingerman adds: “Swift is already being supported on macOS, iOS, iPadOS, tvOS, watchOS, Linux and Windows, and there is some interest in using Swift now for server side development, as well as scripting. Being available in all platforms directly enables building software in Swift and potentially making it available universally with specific customizations per platform. Windows and Linux support still have long ways to go but we see Swift potentially having a great adoption by developers due to it.”
Making It Easy
Finally, step four: make it easy to build great apps.
When Karczewski said, “only watchOS needs a different approach, but it's quite understandable due to how small the watch screen is,” he also made the point that developing for each of Apple’s platforms takes bespoke work. This isn’t exactly the unified endeavor it should be.
But if we examine the state of Apple’s various platforms in 2021—particularly with macOS Big Sur and iOS widgets—we see many overlapping design elements. It’s all contextual and squircle-y, with calls-to-action. This fits and scales to every screen, from your iMac to your Apple Watch. Squircles, contextual widgets, and calls to action are likely what we can expect with Apple’s augmented reality platform, as well.
SwiftUI is how Apple envisions we’ll all design and develop the cross-platform apps of the future, and there’s good reason to believe it’ll work. Famed Udemy instructor and founder of the London App Brewery Dr. Angela Yu tells Dice: “With so much fragmentation in the device landscape, mobile developers have been asking for a much simpler and more intuitive way of building apps that can scale across all Apple devices. This is why SwiftUI has entered the scene with features such as drag-and-drop code creation, vertical-horizontal-Z axis stack, reusable UI components, and the ability to build across Apple platforms.
Last year, Yu added, “saw the popularity of declarative programming skyrocket, mostly thanks to the rise of React, one of the most popular front-end frameworks used today. With Apple entering SwiftUI into the ring, we’re moving further into the declarative world for mobile development. Hopefully, with continued investment and development into SwiftUI, it will become a more enjoyable way of creating iOS apps and adopted by the next generation of iOS developers. The simpler syntax and more straightforward state management will likely encourage more people to pick up Swift and iOS development.”
Coming Together
In 2019, Dice pointed out, “Developers … feel Catalyst is best for porting simple apps, and SwiftUI is great for creating new apps.” This is still accurate. We’ll add that, in 2021, SwiftUI is unfinished; developers waffle between praising its ease of use and bemoaning its befuddling roadblocks. But all Apple’s efforts show promise.
Apple’s last brilliant trick is that it’s not actually created a single platform, which is what messed up Microsoft’s attempts at a universal app ecosystem (too unwieldy and confusing for developers). Rather, it’s unifying the development process for all its unique platforms behind SwiftUI and Catalyst within Xcode. Other efforts, such as Windows, Linux, and web support, will be add-ons to core app functionality for Apple platforms, while also making Swift more approachable to more developers.
Viewed with a broader lens, it’s all slow-rising genius on Apple’s part. Swift is first-class for iOS, AppKit has all but been deprecated in favor of Catalyst, SwiftUI is incredibly easy to use, support outside Apple’s core platforms is growing, and its design language across platforms is suddenly much more unified. Apple isn’t asking developers to create apps that must work on every platform, it’s simply making it hard not to want to do so.
Moreover, it’s reasonable to assume that SwiftUI and Catalyst will one day have components for porting apps to other platforms, making Xcode an IDE of choice. The real coup de grace may be offering the ability to port Mac apps to Windows, or iOS apps to Android, all using Catalyst, SwiftUI, and a Swift-for-Linux backend. Perhaps one day.