SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Adapt Your App to the Needs of a MacOS Application

Embed your app flow in a Split View Controller for Mac Catalyst only, create a settings bundle to enable a preferences menu, and change the menu bar items to have a refresh menu ready to use.

Overview

You will learn

  • ✔How to implement a Split View Controller to support a sidebar on MacOS
  • ✔How to change the Menu Bar items
  • ✔How to create a settings bundle to enable a preferences menu
Kevin Muessig K Kevin Muessig October 12, 2026
Created on January 9, 2023
Contributors

More from Kevin Muessig

See all 13 tutorials by Kevin Muessig →

Prerequisites

  • Development environment: Apple Mac running macOS Catalina or higher with Xcode 13 or higher
  • SAP BTP SDK for iOS: Version 7.0 or higher

Steps

Details

You will learn

  • How to implement a Split View Controller to support a sidebar on MacOS
  • How to change the Menu Bar items
  • How to create a settings bundle to enable a preferences menu

Step 1 Implement a Split View
—

In the last tutorial you made changes to your Xcode project settings to enable Mac Catalyst for your app project. This tutorial is about making some changes to the project to fit better on MacOS without changing the appearance on iPhone or iOS.

You are going to cover the basics for Mac Catalyst and the SAP BTP SDK for iOS but using the previously mentioned documentation in combination with this tutorial series you should be well suited to build great business apps.

In the beginning you want to change the app flow to have a split view in place when running on Mac Catalyst. The split view or Split View allows Mac Catalyst to display a sidebar similar to Apple’s Music or Stocks applications on MacOS.

If you look at the current app structure the user will end up on the Overview screen right after finishing the onboarding process. On MacOS this is going to be the same way with the difference that the user will have a sidebar available where he or she can switch between Overview, Customer and Product list directly.

To implement the new flow you can attach our current app flow in storyboard to a standard Split View Controller.

  1. Open the Main.storyboard and select the Navigation Controller, open the Attributes Inspector to uncheck the Is Initial View Controller. This is necessary because the new main entry point is going to be the Split View Controller.

    !

    Split View Controller
    Split View Controller

  2. Use the Object Library to search for Split View Controller and drag + drop it next to the navigation controller.

    !

    Split View Controller
    Split View Controller

  3. With that in place you can connect the Split View Controller with our current app flow. Delete the View Controller Scene of the Split View Controller in Storyboard first.

    !

    Split View Controller
    Split View Controller

    After deleting your storyboard should look like this now:

    !

    Split View Controller
    Split View Controller

  4. Drag the Navigation Controller of the app flow right next to the Split View Controller and create a storyboard segue between the Split View Controller and the Navigation Controller. As the segue type, select secondary view controller and safe.

    !

    Split View Controller
    Split View Controller

  5. Make the Main Split View Controller the initial view controller for the app by selecting the View controller and using the Attributes Inspector to check the box for Is Initial View Controller.

    !

    Split View Controller
    Split View Controller

    Let’s quickly go over what you did here. First you added a new Split View Controller which is a standard Apple UI control. Then you added our app flow to the Split View Controller through a detail view controller segue. This allows the Split View Controller to automatically manage your Split View lifecycle. You leave the Navigation Controller in as you want to maintain our regular app flow.

    Because the Main View Controller is the new initial view controller you have to change the ApplicationUIManager code accordingly.

    To ensure that you will see the standard app flow while running on iOS and displaying the Split View when running on Mac Catalyst you can use environmental conditions to distinct different initialization code.

    Swift
    #if targetEnvironment(macCatalyst)
    #else
  6. Open the ApplicationUIManager.swift file and locate the showApplicationScreen(completionHandler:) method. Right now you can see that you’re initializing the Navigation Controller as our initial screen but you have to change that to be adaptable to Mac Catalyst. Change the implement code to the following and read the inline comments carefully:

    Swift[12-25]
       func showApplicationScreen(completionHandler: @escaping (Error?) -> Void) {
           // Check if an application screen has already been presented
           guard isSplashPresented else {
               completionHandler(nil)
               return
           }
    
           // set rootViewController only once ie after onboarding when app screen is about to be shown
           // for restore, remove covering views previously added
           let appViewController: UIViewController
           if isOnboarding {
    #if targetEnvironment(macCatalyst)
               let splitViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateInitialViewController() as! UISplitViewController
    
               splitViewController.modalPresentationStyle = .currentContext
               splitViewController.preferredDisplayMode = .allVisible
               appViewController = splitViewController
    
               // If running on iOS show the OverviewTableViewController
    #else
               let overviewTVC = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "OverviewTableViewController") as! OverviewTableViewController
               appViewController = overviewTVC
    #endif
    
               isOnboarding = false
               coveringViews.removeAll()
    
               // maintain this boolean since no splash screen is present now
               isSplashPresented = false
               window.rootViewController = appViewController
           } else {
               removeCoveringViews()
           }
    
           completionHandler(nil)
       }
  7. Run the app on the My Mac scheme and you should see you app being in Split View now and you can see that beautiful empty sidebar. Also if you have noticed the system automatically knows that your app wants to receive Push Notifications and the Mac Catalyst makes sure that MacOS displays it accordingly.

    In case you run into the issue “Apple Development Identity is Ambiguous. Multiple Certificates are found in your keychain for identity Apple Development”, you can follow this blog post for resolution of the problem Handling Ambiguous Apple Developer Identity.

    !

    Split View Controller
    Split View Controller

Step 2 Implement root view controller UI
+
Step 3 Implement root view controller logic
+
Step 4 Change the menu bar
+
Step 5 Create settings bundle
+
Step 6 Change app title
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Implement a Split View 2. Implement root view controller UI 3. Implement root view controller logic 4. Change the menu bar 5. Create settings bundle 6. Change app title