
Marzipan, Apple's (alleged) unified platform for mobile and desktop, continues to float around the proverbial rumor mill. But according to the latest scuttlebutt, it seems a more sensible option for cross-platform applications may be on the horizon. News that Apple might announce a merger of sorts between iOS and macOS, the company’s respective mobile and desktop operating systems, has sparked a lot of interest. Developer and users alike are starting to consider how such a system may look, and how they’d take advantage of it. The upshot for users is clear: more apps. The macOS platform has undeniably stagnated with regard to third-party support, and the Mac App Store is in desperate need of a refresh. What was once a focused store and platform has given way to apps ignoring the storefront altogether, as well as cumbersome, intensive Electron apps shoving native AppKit apps aside. For developers, these rumors breathe new life into the ‘write once, deploy everywhere’ horcrux we’ve long been searching for. With Marzipan, the alleged codename for Apple’s internal unified operating system, that’s exactly what the rumors promise. Apple would likely deprecate macOS’s AppKit framework for iOS’s UIKit, leaving developers the ability to write one monolithic app and sell it across platforms. Logically, this makes sense. Desktop apps can be constrained with window sizing, and there are a lot of missed opportunities for native desktop apps. A reason most iOS apps don’t make their way to the Mac is that developers don’t see any reason to make an AppKit app after writing a UIKit app; doubling your efforts for minimal gain is just not smart. [caption id="attachment_139520" align="aligncenter" width="2048"] Apple Platforms[/caption]
The Shifting Sands of Marzipan
The most recent news of Apple’s cross-platform efforts come from testy pundit John Gruber, who asserts the following:
…basically it sounds like a declarative control API. The general idea is that rather than writing classic procedural code to, say, make a button, then configure the button, then position the button inside a view, you instead declare the button and its attributes using some other form. HTML is probably the most easily understood example. In HTML you don’t procedurally create elements like paragraphs, images, and tables — you declare them with tags and attributes in markup.
Gruber goes on to note, “There’s nothing inherently cross-platform about a declarative control API,” adding it makes sense that there would be such tooling if apps were to work for AppKit and UIKit. Mark Gurman of Bloomberg, who originally broke the news of ‘Marzipan,’ isn’t ready to admit Gruber’s info tells the whole story:
Sounds like that‘s referring to a pair of separate projects (known alternately as “Amber,” “Infrared” and “Ultraviolet”) from the Swift team. Not the same as the iOS apps on Macs initiative. There are many moving pieces with a major multi-year, multi-step project like this. https://t.co/jXKa5vRTzi
— Mark Gurman (@markgurman) May 1, 2018
Essentially, Gruber seems to be saying ‘Marzipan’ is really an API to make iOS and macOS apps work better together, while Gurman says the API is one aspect of a larger project.
Marzipan, React, and Swift
Let’s start with Gurman’s follow-up tweet to the one above:
This initiative likely intends to replace NIB files with Swift, linked to Interface Builder, which could allow developers to declare their UIs by hand or by using the existing visual tools, much like XAML on Windows.
— Mark Gurman (@markgurman) May 1, 2018
It’s something Gruber hints at in his post, writing: "There’s an industry-wide trend toward declaration, perhaps best exemplified by React, that could be influencing Apple in this direction.” I’ve long posited Apple may be waging a shadow-war on React, as much of its recent efforts to cull ‘bad’ apps from the iOS App Store affect apps using the React Native framework. To wit, the main offense is that those apps use widely duplicated external frameworks and are not quality submissions. But Gruber’s point that React is a great example of declaration rings true. And perhaps Apple’s apparent rankle with React is that it doesn’t play entirely within Apple’s walled garden. So, we may get Marzipan or some sort of API to mimic what React does so well; it’s not ‘sherlocking’ so much as it is creating a better environment for Apple’s loyal user-base. Declarative APIs aren’t new. Gurman’s point about XAML is well received, and Windows makes use of declaration in the AdaptiveTrigger
class, which allows unique rendering depending on screen size and orientation. The main idea of declarative APIs is to separate app logic from views. If we’re getting cross-platform apps, this makes sense. More to the point, it makes good sense for the Fall, when Swift gains ABI stability. Even more central is that Swift is quickly becoming a language useful for server-side use-cases, such as databases – where an app’s logic is usually held.
Sweet & Sour Marzipan
If all the rumblings are accurate, Marzipan looks like a tie that binds rather than a unified platform... so far. A declarative API available within Xcode for iOS and macOS app development might be a toe-dip in the big water. In the short term, it’s a good way for iOS developers to introduce themselves to macOS development, which many simply haven’t done. Winding our way back to XAML, Microsoft describes it as a markup language that “enables a workflow where separate parties can work on the UI and the logic of an application, using potentially different tools.” If Apple were to mimic that for iOS and macOS development, it’s a silver bullet solution that both makes sense and avoids the disaster of a hard left turn for the desktop ecosystem. And perhaps such an API is a setup for Marzipan. Similarly, it could be a soak test to see how many really care to bring their apps to the desktop using a fairly straightforward and simple tool. Unfortunately, the common thinking is that we won’t see the API or Marzipan this June at WWDC, Apple’s annual developer’s conference. But don’t be surprised if we actually do see the API show up at some point. Both iOS 12 and a new macOS version will drop this Fall, and we’ll hear about both at WWDC; betas for both will appear soon after the keynote. If cross-platform apps are really coming via the API, developers will want to have time to explore the API while the operating systems are in beta.