We are excited to announce that starting with Salesforce Mobile SDK for iOS, Mac Catalyst developers can quickly and easily run their iPhone and iPad apps on Mac, including the latest iMac, 13-inch MacBook Pro, MacBook Air, and Mac mini powered by Apple’s M1 chip.
To get started, simply click the Mac checkbox in your iPad app’s project settings to configure the project to build both Mac and iPad versions of your app. The two apps share the same project and source code, making it easy to change your code in one place. Review Turning on Mac Catalyst for more details.
Building apps for M1-powered Macs provides developers and end users with even more flexibility to expand to a new form factor.
This means that developers can create apps with features like offline availability and allow end users to run them on Mac in the field with little or no network connection. The app will continue to work just like it would on a Mobile SDK iPad app. This opens up so many possibilities and changes what we think of as a mobile device.
What’s changed in Salesforce Mobile SDK 9.1?
“If running my iPad apps on Mac requires little or no changes, then what exactly did Salesforce do in Mobile SDK 9.1?”
Mobile SDK 9.1 enables Catalyst on our SDK frameworks and existing SDK for iOS sample apps. We updated our internal APIs to make them available on Catalyst. They previously would only work on iPad and iPhone. We also updated our dependencies to ones with Catalyst enabled.
The following Mobile SDK frameworks were updated and have been enabled for Catalyst support:
Mobile SDK samples & templates
We have enabled Catalyst for the RestAPIExplorer sample and the MobileSyncExplorerSwift template. This means that you can easily use these samples to view how Mobile SDK apps that access Salesforce data and run offline behave on all the existing and new form factors — iPhone, iPad, Intel Mac, and Macs with M1 or Intel chips. You can then leverage any changes we made to help these apps run better on Mac from an end user perspective. This includes some minor UI tweaking for sizing.
MobileSyncExplorerSwift on iPad
MobileSyncExplorerSwift on Mac
The MobileSyncExplorerSwift template has also been updated to include Multiple Windows support. This feature works on both iPad and Mac.
Design considerations for your apps
As you build Salesforce Mobile SDK for iOS apps, there are difference between the user experience on each form factor to consider. Most may be in the UI design experience, but we have identified two key Mobile SDK features that may not be needed when building for Mac.
Passcode makes a lot of sense for most Mobile SDK apps that access Salesforce data. However, this may not be needed for Mac apps. For our Mobile SDK samples and templates, we continue to support passcode for now and it works as expected on Mac.
Snapshot is a feature that makes sense on iPhone and iPad apps, but doesn’t make sense for the end user when the app runs on Mac. It is automatically disabled when running on macOS.
For additional design considerations, review Mac Catalyst – Human Interface Guidelines.
Get started now
To get started, the first thing you want to do is upgrade to the latest version of Salesforce Mobile SDK for iOS. The minimum version that supports Mac is Mobile SDK 9.1.
Before you create or modify your Mobile SDK for iOS apps, you need to first configure your Xcode project to use Mac Catalyst. Review more details and a sample from Apple in Turning on Mac Catalyst.
If you are building a new app from scratch, you can start with the MobileSyncExplorerSwift template, which has already been modified to run on Mac.
If you have an existing Mobile SDK app, simply turn on Mac Catalyst with Mobile SDK 9.1 and check your app on Mac.
Download the latest Salesforce Mobile SDK for iOS today!
About the author
Sue Berry is a Director of Product Management at Salesforce where she focuses on Salesforce Mobile. She’s currently working on Salesforce Mobile SDK and the new Mobile tools for LWC debugging. She has been building developer tools for over 15 years.