The future of cross-platform Apple November 19, 2019

Image for The future of cross-platform Apple

In this post, one of our star iOS developers – Brent Van Vosselen – guides us through how you used to develop for Apple products and what the future will bring.

Introduction 

MacOS already exists 18 years. In June 2007, Apple released one of the most ground-breaking products in the tech industry: the iPhone. It ran a new Operating System (OS) called iOS.

To develop apps on this new OS, developers needed to use a new SDK. A SDK is a collection of software used for developing applications for a specific device or operating system. To create the UI for iPhone applications, developers needed to use a new UI-framework called UIKit. This framework allows developers to create specific user interface functionality. This new way of working was however only applicable for iPhone applications, macOS applications used a different UI-framework called AppKit.

This meant that in order to have an app for both iOS and macOS, you need to create and maintain two distinct codebases. Because of this, everything for the user interface needs to be coded twice: one time for each platform. Usually this is done by a different team, which creates a lot of overhead and increases the cost of development and maintenance. Historically this resulted in many companies choosing to develop on just one of Apple’s platforms, in many cases iOS, without releasing a macOS version of their application.
A few years after the release of the iPhone, Apple released the Apple watch which again, came with a new OS – watchOS – and a corresponding UI-framework, WatchKit.
 

Even though all these operating systems, iOS, macOS and watchOS, run on the same core they all have their respective SDK and UI-frameworks. To this day it wasn’t possible to easily develop for multiple platforms. In this post we write up how Apple will allow us to share code in the future. 

Project Catalyst 

To address this problem, Apple looked into a solution. At the World Wide Developers Conference (WWDC) of 2018 Apple announced Project ‘Marzipan’. WWDC is the yearly event from Apple where they showcase new software and technologies for software developers. Project Marzipan would let apps made for an iPad, run on a Mac. Back then, Apple already ported four of their apps and said in the future that third party app developers will be able to do the same. At the WWDC of 2019, Apple made Project Marzipan open for the public and renamed it. Project Catalyst was born. It lets you create universal apps that are able to run on the iPhone, iPad and the Mac. This means there is no need to learn the two different UI frameworks to be able to develop apps that work on both iOS and macOS devices. 

 

In the current state of Project Catalyst, it is not possible to make every iOS app run perfectly on macOS. The experience is already quite good, but not all the frameworks available on iOS are available on macOS. If the framework takes advantage of hardware features found on mobile devices, it probably won’t be available on macOS.

There are ways to exclude bits of code only available for iOS in the macOS app. However, this is not always desirable, especially if these are the core features of your application.
Your app won’t look like a 1:1 copy of your iPad app, instead it will be adapted to the user interface users already know from macOS. This is the result of the fact that some controls used in iOS don’t exist on Mac. They will be replaced with alternatives which are used on Mac. This results in an application that looks and feels like a native Mac app, while not being developed with first focus on Mac. What Project Catalyst brings doesn’t mean that there are no changes necessary in order to create a great Mac app, but it takes significantly less effort to bring your iPad app to the Mac. 

SwiftUI 

In 2014, Apple released a new open-source language called Swift. Since then, the language has been updated and evolved to a more mature programming language.  

After years of using UIKit and AppKit to create the user interface of your app, Apple released a new UI framework, which carries the name SwiftUI. SwiftUI is written completely in Swift, hence its name. 

SwiftUI is a completely new way to create user interfaces on Apple’s platforms. As a developer, it’s now possible to create user interfaces for all of Apple’s platforms using only SwiftUI. Instead of working with imperative programming models, you can now create your UI in a declarative way with SwiftUI. In imperative programming you tell the program on how its state should be changed, while in declarative programming you describe what the program should look like. 

The Future 

The release of these new things for developers could lead to some interesting changes in the future. It looks like Apple isn’t going to release a single OS for all its platforms soon. Instead it seems to make the development of apps for its platforms a more integrated experience. This could lead to a more filled Mac App Store, which is quite empty at the moment. 

SwiftUI will most likely become more mature in the upcoming years in the same way Swift became more mature in the past years. This will lead to one complete framework, which can be used to create the UI on all of Apple’s platforms.  

Project Catalyst on the other hand, could mean that a lot of great iPad apps will have its native Mac counterpart in an easier way than ever before. This makes creating apps that work cross-platform on Apple’s operating systems possible from a single codebase. 

Our Vision 

Flow Pilots is an advocate of going cross-platform. We are keen to try all these new things out and being able to deliver great apps on more platforms with less effort. It will be remarkably interesting to see where Apple is going with their development tools for its platforms and the benefits it will bring so that we can continue to create wonderful experiences on Apple’s platforms for our customers. 

© Brent Van Vosselen
© Pictures by Apple

Are you interested in a position at Flow Pilots? Take a quick look at our website or follow us on FacebookTwitter , Instagram or Linkedin