ServerSwitchUIProtocol

public protocol ServerSwitchUIProtocol

Server Switch UI Protocol

  • Returns an instance of the class conforming to ServerSwitchUIProtocol protocol

    Declaration

    Swift

    static func instance() -> ServerSwitchUIProtocol?
  • Prompt the user to confirm adding a new server or switching to another server.

    Remark

    The UI class conforming to this protocol does not have to take care of dismissing itself once user responds.

    Declaration

    Swift

    func promptForConfirmation(targetServer server: Server, certificate: TLSCertificate?, mode: ConfirmServerMode, completion: @escaping (_ confirmed: Bool) -> Void)
    Parameters
    server

    The server to be switched to.

    certificate

    The server’s certificate.

    mode

    Specifies if the confirmation is for adding new server or switching to another server.

    completion

    Completion block to be called with the user’s confirmation response.

  • Notifies the user that the server switch cannot be done since the server is already configured.

    Default Implementation
    Declaration

    Swift

    func notifyServerSwitchNotNeededToServer(_ server: Server, completion: @escaping () -> Void)
  • Dismiss any UI presented by the promptForConfirmation(targetServer:certificate:mode:completion:) or notifyServerSwitchNotNeeded(completion:) methods .

    Declaration

    Swift

    func dismiss()