Multi-Window Support¶
Multi-window support using SceneDelegate
allows you to create and manage multi-window apps. This feature enhances and introduces new APIs in SAPFoundation, SAPFioriFlows, and provides appropriate code changes in the generated code as well.
Projects generated by the SAP BTP SDK Assistant for iOS version 9.1 will use these APIs correctly out-of-the-box.
During onboarding, a single scene will be responsible for the onboarding process, while other scenes, if any, will wait until the onboarding process is completed successfully. If the current onboarding scene gets closed or terminated, one of the other scenes will assume responsibility and restart the onboarding process. Similarly, a single scene will be responsible for handling the passcode screen, while other scenes if any, will wait until the passcode has been entered. If the current passcode scene gets closed or terminated, one of the other scenes will assume responsibility and display the passcode screen.
After onboarding/entering the passcode successfully, each scene will have its own view of the app.
Use the SAP BTP SDK Assistant for iOS to create a reference application compatible with multi-window support or use the entire SDK framework stack to build end-to-end apps and make appropriate changes on the application side.
It is recommended to make use of the Assistant to create a reference application for easier adoption of this feature.
Alternatively, you can make use of the SDK frameworks and adopt the following code changes to enable multi-window support.
Code Changes Required For Multi-Window Support¶
- Implement the
SceneDelegateObserving
and register its instance inSceneDelegateDispatcher
before initiating the onboarding as described below. Also, set the current Scene Session ID inSceneManager
.
let observer = SceneDelegateObserver(sceneSessionID: scene.session.persistentIdentifier)
SceneDelegateDispatcher.register(scene: scene.session.persistentIdentifier, observer)
SceneManager.shared.setCurrentSceneSessionID(id: scene.session.persistentIdentifier)
-
Maintain a single
OnboardingSessionManager
instance during the application life cycle. -
Dispatch the following scene life cycle events from your
SceneDelegate
implementation toSceneDelegateDispatcher
.
SceneDelegateDispatcher.sceneDidDisconnect(scene)
SceneDelegateDispatcher.sceneWillEnterForeground(scene)
SceneDelegateDispatcher.sceneDidEnterBackground(scene)
- Perform the necessary UI-related setup in delegate methods of
ApplicationUIManaging
.
func hideApplicationScreen(scene sessionID: String?, completionHandler: @escaping (Error?) -> Void)
func showApplicationScreen(scene sessionID: String?, completionHandler: @escaping (Error?) -> Void)
func showProgressScreenForOnboarding(scene sessionID: String, completionHandler: @escaping (Error?) -> Void)