Files
element-x-ios/ElementX/Sources/Application/AppCoordinatorProtocol.swift
T
Stefan Ceriu f1ef968975 Introduce support for multiple windows on mac and iPad OS
Once the app starts the WindowManager is configured with SwiftUI's environment OpenWindowAction. It can then be used to register coordinators (that provide the toPresentable view) and an optional flow coordinator (as most of the screens are part of a flow, especially rooms).
Once a coordinator is registed, the WindowManager invokes the OpenWindowAction which in turn makes the Application call its newly introduced WindowManagerWindowType WindowGroup's block to instantiate a new visual window rooting that view.

The WindowManager is also responsible for wrapping the presentable in a disappearance block and clean up the coordinator stack.

# Conflicts:
#	ElementX/Sources/Application/AppCoordinator.swift
2026-03-31 20:33:33 +03:00

23 lines
765 B
Swift

//
// Copyright 2025 Element Creations Ltd.
// Copyright 2022-2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import Foundation
@MainActor
protocol AppCoordinatorProtocol: CoordinatorProtocol {
var windowManager: SecureWindowManagerProtocol { get }
@discardableResult func handleDeepLink(_ url: URL, isExternalURL: Bool, windowType: WindowManagerWindowType?) -> Bool
func handleAppRoute(_ appRoute: AppRoute, windowType: WindowManagerWindowType?)
func handlePotentialPhishingAttempt(url: URL, openURLAction: @escaping (URL) -> Void) -> Bool
func handleUserActivity(_ userActivity: NSUserActivity)
}