Mac Catalyst and Why You Should Use It.png

Mac Catalyst and Why You Should Use It

Nowadays, everyone is in a rush to make an app that has the perfect UI and all the possible features using the latest technologies. Whether you are creating an app from scratch or you have already released it to the public, it can happen that sometimes you might miss making your app accessible across other Apple lineups of devices.

On that occasion, in the following article, we give a deep dive into one of the many ways you can bring your iOS app to the macOS world.

What is Mac Catalyst?

Back when Apple was presenting the new features and tools that will be available on the WWDC19, among the features was Mac Catalyst, previously known by the code name “Project Marzipan”.  Mac Catalyst is a tool that brings the iOS UIKit to the macOS world and allows developers to bring their iPad apps onto the Mac very rapidly and with less headache.

Starting from macOS Catalina, many of Apple’s own apps running across iOS and macOS ecosystems are built using Catalyst. This Catalyst list includes:

  • Maps
  • News
  • Voice Memos
  • Podcast
  • Reminders

If you’ve used any of these apps on Mac or iPad, you will notice that they are quite similar in structure, but the apps actually feel quite genuine on their respective platforms. Even when you run your iPad app on Mac without modification, you’ll find that it already adopts many of the Mac standard UI native features. It’s not just your iPad app running on a desktop simulator.

First-Party apps made with Catalyst

This is still a new tool for all of us to simply jump right into, so here are some examples of apps that Apple migrated to the Mac using this framework. On the left, we have an image of the iPad version and on the right, the Mac version.

Reminders

Mac Catalyst and Why You Should Use It 2.png

Voice memos

Mac Catalyst and Why You Should Use It 3.png

Podcasts

Today, we have numerous apps on the App Store or out in the public using this framework. As we see in the images above, all three applications share near the same UI design and the functionalities are pretty much the same for both platforms. The conclusion from these examples is that the side menu supporting larger screens and landscape mode is the gold standard rule for apps.

What are the benefits of using Catalyst?

  • Speed: Spending less time bringing the app to Mac and focusing more on the business logic and new features
  • Single codebase: Making the changes in one codebase and applying them to all platforms is very useful and powerful
  • Expanding the market and users: With a little effort, your app will gain more users and it will be discoverable on more platforms
  • Design adaptability: Every app built with Catalyst and running on macOS Big Sur is adapted to the new software design
  • Universal Mac/iOS purchases: Distributing subscriptions to all the platforms that your app supports
  • And there are also a few other features that come free out of the box when using the Catalyst:
    • Copy & Paste support
    • Basic drag and drop
    • Support for system touch bar controls
    • Mac-style scroll bars
    • Basic Mac menu bar
    • Trackpad, mouse, and input from a keyboard
    • Window resizing and full-screen mode

Before you start you should know

Catalyst is all about letting you use the code you’ve written for iOS on macOS. But not just any code! At least for now, you can only run code that is written for iPad on Mac. And since most of the code runs on both platforms, before you dive into running your app on Mac, there are a few things you should do to make your code production-ready.

The job is not always done by just ticking all checkboxes – there is still work that needs to be done in order to make your app a top-notch Mac experience. Below are some features that you need to implement on your own:

  • Better navigation structure because the standard for Mac apps is the split navigation view (Sidebar). The current iPhone navigation is neither automatically adapted nor looks good.

On the link, you can find the official tutorial on how to create a sidebar.

Keyboard shortcuts and menus are the most used features in Mac applications, so make sure you dedicate your time and focus on creating a good user experience. First, build a UIKeyCommand that represents the shortcut and then add the children option to the UIMenu.

For example:

class func openMenu() -> UIMenu {
    let openCommand =
        UIKeyCommand(title: NSLocalizedString("OpenTitle", comment: ""),
        image: nil,
        action: #selector(AppDelegate.openAction),
        input: "o",
        modifierFlags: .command)
let openMenu =
        UIMenu(title: "",
        image: nil,
        identifier: .openMenu,
        options: .displayInline,
        children: [openCommand])
return openMenu
}

Click on the link, to find the documentation.

  • By default, Mac apps built with Mac Catalyst display a title bar across the top of their windows. If you choose to design your window without a title bar, you must remove it from the window. To remove the title bar, set the title bar’s titleVisibility property to UITitlebarTitleVisibility.hidden and the toolbar property to nil.

You can find more on the link.

We know that Catalyst gives you plenty of Mac features for free. However, before you make a great Mac app using Catalyst, you should try and make an iPad app first.

Framework and UI availability

While Apple makes the experience of running iPad apps on Mac quite frictionless, not all frameworks available on iOS are available on macOS. For example, frameworks that take advantage of hardware features found only on mobile devices, like CoreNFC and ARKi, are not available on macOS. All the applications that are dependent on this type of framework must comment out when using Catalyst.  

And last but not least, if your core UI is dependent on some UI frameworks that don’t support Catalyst, then you should read below:

Mac Catalyst and Why You Should Use It 5.png

Conclusion

Building great Mac applications will take time, patience, and a lot of effort on your behalf or your team's. Mac Catalyst is still an early technology but it can be carried out with a great deal of effort.

In the last two years, we see how platforms are moving closer to each other. iPad with an external keyboard and mouse support isn’t that different from Mac anymore. Nevertheless, for now, we know that iPads are not capable of replacing laptops for development, but who knows what will the future bring.

And while we are all waiting for the next WWDC when Apple announces the new APIs and features this framework can do, try and bring unique experiences to Mac users using the available tools and always think of creative ways you can migrate the apps.

Martin Stojcev

Mar 21, 2022

Category

Article

Technologies

Mac Catalyst

Let's talk.

Name
Email
Phone
By submitting this, you agree to our Terms and Conditions & Privacy Policy