Remove old methods from onboarding coordinator and tabbar controller

This commit is contained in:
ismailgulek
2022-06-07 16:15:35 +03:00
parent 1bf3c06d6e
commit 043ad4e5df
5 changed files with 3 additions and 107 deletions
@@ -42,13 +42,6 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
// MARK: Private
private let parameters: OnboardingCoordinatorParameters
// TODO: these can likely be consolidated using an additional authType.
/// The any registration parameters for AuthenticationViewController from a server provisioning link.
private var externalRegistrationParameters: [AnyHashable: Any]?
/// A custom homeserver to be shown when logging in.
private var customHomeserver: String?
/// A custom identity server to be used once logged in.
private var customIdentityServer: String?
// MARK: Navigation State
private var navigationRouter: NavigationRouterType {
@@ -113,21 +106,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
func toPresentable() -> UIViewController {
navigationRouter.toPresentable()
}
/// Force a registration process based on a predefined set of parameters from a server provisioning link.
/// For more information see `AuthenticationViewController.externalRegistrationParameters`.
func update(externalRegistrationParameters: [AnyHashable: Any]) {
self.externalRegistrationParameters = externalRegistrationParameters
legacyAuthenticationCoordinator.update(externalRegistrationParameters: externalRegistrationParameters)
}
/// Set up the authentication screen with the specified homeserver and/or identity server.
func updateHomeserver(_ homeserver: String?, andIdentityServer identityServer: String?) {
self.customHomeserver = homeserver
self.customIdentityServer = identityServer
legacyAuthenticationCoordinator.updateHomeserver(homeserver, andIdentityServer: identityServer)
}
// MARK: - Pre-Authentication
/// Show the onboarding splash screen as the root module in the flow.
@@ -259,14 +238,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
break
}
}
// Due to needing to preload the authVC, this breaks the Coordinator init/start pattern.
// This can be re-assessed once we re-write a native flow for authentication.
if let externalRegistrationParameters = externalRegistrationParameters {
coordinator.update(externalRegistrationParameters: externalRegistrationParameters)
}
coordinator.customServerFieldsVisible = useCaseResult == .customServer
if let softLogoutCredentials = parameters.softLogoutCredentials {
@@ -277,11 +249,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
coordinator.start()
add(childCoordinator: coordinator)
if customHomeserver != nil || customIdentityServer != nil {
coordinator.updateHomeserver(customHomeserver, andIdentityServer: customIdentityServer)
}
if navigationRouter.modules.isEmpty {
navigationRouter.setRootModule(coordinator, popCompletion: nil)
} else {
@@ -20,8 +20,6 @@ import Foundation
@objcMembers
class OnboardingCoordinatorBridgePresenterParameters: NSObject {
/// The external registration parameters for AuthenticationViewController.
var externalRegistrationParameters: [AnyHashable: Any]?
/// The credentials to use after a soft logout has taken place.
var softLogoutCredentials: MXCredentials?
}
@@ -86,17 +84,6 @@ final class OnboardingCoordinatorBridgePresenter: NSObject {
self.navigationType = .push
}
/// Force a registration process based on a predefined set of parameters from a server provisioning link.
/// For more information see `AuthenticationViewController.externalRegistrationParameters`.
func update(externalRegistrationParameters: [AnyHashable: Any]) {
coordinator?.update(externalRegistrationParameters: externalRegistrationParameters)
}
/// Set up the authentication screen with the specified homeserver and/or identity server.
func updateHomeserver(_ homeserver: String?, andIdentityServer identityServer: String?) {
coordinator?.updateHomeserver(homeserver, andIdentityServer: identityServer)
}
func dismiss(animated: Bool, completion: (() -> Void)?) {
guard let coordinator = self.coordinator else {
return
@@ -137,10 +124,6 @@ final class OnboardingCoordinatorBridgePresenter: NSObject {
onboardingCoordinator.completion = { [weak self] in
self?.completion?()
}
if let externalRegistrationParameters = parameters.externalRegistrationParameters {
onboardingCoordinator.update(externalRegistrationParameters: externalRegistrationParameters)
}
return onboardingCoordinator
}
}
@@ -20,11 +20,4 @@ import Foundation
/// full onboarding flow with pre-auth screens, authentication and setup screens once signed in.
protocol OnboardingCoordinatorProtocol: Coordinator, Presentable {
var completion: (() -> Void)? { get set }
/// Force a registration process based on a predefined set of parameters from a server provisioning link.
/// For more information see `AuthenticationViewController.externalRegistrationParameters`.
func update(externalRegistrationParameters: [AnyHashable: Any])
/// Set up the authentication screen with the specified homeserver and/or identity server.
func updateHomeserver(_ homeserver: String?, andIdentityServer identityServer: String?)
}