diff --git a/NevisExampleApp.xcodeproj/project.pbxproj b/NevisExampleApp.xcodeproj/project.pbxproj index 4cb44b8..6709164 100644 --- a/NevisExampleApp.xcodeproj/project.pbxproj +++ b/NevisExampleApp.xcodeproj/project.pbxproj @@ -115,7 +115,6 @@ 38E1CBF32A8E31DE00D4F7EB /* DevicePasscodeUserVerifierImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38E1CBF22A8E31DE00D4F7EB /* DevicePasscodeUserVerifierImpl.swift */; }; 38FF9DC5292E09E70027C09E /* CredentialView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38FF9DC4292E09E70027C09E /* CredentialView.swift */; }; 38FF9DC7292E0B160027C09E /* LoggingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38FF9DC6292E0B160027C09E /* LoggingView.swift */; }; - 9BE0F5E78A6A916FF7E09A96 /* Pods_NevisExampleApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F141C519C68C029C049F2F79 /* Pods_NevisExampleApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -125,7 +124,6 @@ 06000BB12C37EE6A00AB53A1 /* PasswordUserVerifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordUserVerifier.swift; sourceTree = ""; }; 06471B142C29685C006879F9 /* AuthenticatorAaid+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AuthenticatorAaid+Extensions.swift"; sourceTree = ""; }; 068E9ABB2C2D60BA0059E33C /* AuthenticatorValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticatorValidator.swift; sourceTree = ""; }; - 0B956422D44439C093E00399 /* Pods-NevisExampleApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NevisExampleApp.release.xcconfig"; path = "Target Support Files/Pods-NevisExampleApp/Pods-NevisExampleApp.release.xcconfig"; sourceTree = ""; }; 382FE1D62BADD5FC00999625 /* ConfirmationPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmationPresenter.swift; sourceTree = ""; }; 382FE1D82BADD60400999625 /* ConfirmationScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmationScreen.swift; sourceTree = ""; }; 3833EB192685EA03002C5E0C /* NevisExampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NevisExampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -232,8 +230,6 @@ 38E1CBF22A8E31DE00D4F7EB /* DevicePasscodeUserVerifierImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DevicePasscodeUserVerifierImpl.swift; sourceTree = ""; }; 38FF9DC4292E09E70027C09E /* CredentialView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialView.swift; sourceTree = ""; }; 38FF9DC6292E0B160027C09E /* LoggingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggingView.swift; sourceTree = ""; }; - 67BBC52FF1A43798284EED29 /* Pods-NevisExampleApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NevisExampleApp.debug.xcconfig"; path = "Target Support Files/Pods-NevisExampleApp/Pods-NevisExampleApp.debug.xcconfig"; sourceTree = ""; }; - F141C519C68C029C049F2F79 /* Pods_NevisExampleApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NevisExampleApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -241,7 +237,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9BE0F5E78A6A916FF7E09A96 /* Pods_NevisExampleApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -282,8 +277,6 @@ children = ( 3833EB1B2685EA03002C5E0C /* NevisExampleApp */, 3833EB1A2685EA03002C5E0C /* Products */, - A651FDC4F5C71ADD993EA999 /* Pods */, - 8E9E59B3AFC9FF84E096D1EB /* Frameworks */, ); sourceTree = ""; }; @@ -694,19 +687,9 @@ path = "Username Password Login"; sourceTree = ""; }; - 8E9E59B3AFC9FF84E096D1EB /* Frameworks */ = { - isa = PBXGroup; - children = ( - F141C519C68C029C049F2F79 /* Pods_NevisExampleApp.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; A651FDC4F5C71ADD993EA999 /* Pods */ = { isa = PBXGroup; children = ( - 67BBC52FF1A43798284EED29 /* Pods-NevisExampleApp.debug.xcconfig */, - 0B956422D44439C093E00399 /* Pods-NevisExampleApp.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -718,12 +701,10 @@ isa = PBXNativeTarget; buildConfigurationList = 3833EB2D2685EA03002C5E0C /* Build configuration list for PBXNativeTarget "NevisExampleApp" */; buildPhases = ( - 79CB52AC7DDC23DF75949849 /* [CP] Check Pods Manifest.lock */, 3867C1972685EE1F00A8B98B /* Swiftformat */, 3833EB152685EA03002C5E0C /* Sources */, 3833EB162685EA03002C5E0C /* Frameworks */, 3833EB172685EA03002C5E0C /* Resources */, - B33D1E141A1B58EE4EBF5ABB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -803,45 +784,6 @@ shellPath = /bin/sh; shellScript = "if which swiftformat >/dev/null; then\n echo \"SwiftFormat version: $(swiftformat --version)\"\n swiftformat \"${SRCROOT}/\"\nelse\n echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\nfi\n"; }; - 79CB52AC7DDC23DF75949849 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-NevisExampleApp-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - B33D1E141A1B58EE4EBF5ABB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NevisExampleApp/Pods-NevisExampleApp-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-NevisExampleApp/Pods-NevisExampleApp-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NevisExampleApp/Pods-NevisExampleApp-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1099,7 +1041,6 @@ }; 3833EB2E2685EA03002C5E0C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 67BBC52FF1A43798284EED29 /* Pods-NevisExampleApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -1131,7 +1072,6 @@ }; 3833EB2F2685EA03002C5E0C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0B956422D44439C093E00399 /* Pods-NevisExampleApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; diff --git a/NevisExampleApp/Interaction/AuthenticatorSelectorImpl.swift b/NevisExampleApp/Interaction/AuthenticatorSelectorImpl.swift index 84cc07f..a23a596 100644 --- a/NevisExampleApp/Interaction/AuthenticatorSelectorImpl.swift +++ b/NevisExampleApp/Interaction/AuthenticatorSelectorImpl.swift @@ -33,7 +33,7 @@ class AuthenticatorSelectorImpl { /// The configuration loader. private let configurationLoader: ConfigurationLoader - /// The mode of the current operation. + /// The current operation. private let operation: Operation // MARK: - Initialization @@ -44,6 +44,7 @@ class AuthenticatorSelectorImpl { /// - appCoordinator: The application coordinator. /// - logger: The logger. /// - configurationLoader: The configuration loader. + /// - operation: The current operation. init(appCoordinator: AppCoordinator, logger: SDKLogger, configurationLoader: ConfigurationLoader, diff --git a/NevisExampleApp/Interaction/Password/PasswordChangerImpl.swift b/NevisExampleApp/Interaction/Password/PasswordChangerImpl.swift index 9cedbba..b3258fd 100644 --- a/NevisExampleApp/Interaction/Password/PasswordChangerImpl.swift +++ b/NevisExampleApp/Interaction/Password/PasswordChangerImpl.swift @@ -53,6 +53,6 @@ extension PasswordChangerImpl: PasswordChanger { /// You can add custom Password policy by overriding the `passwordPolicy` getter. // func passwordPolicy() -> PasswordPolicy { -// // custom PinPolicy implementation +// // custom PasswordPolicy implementation // } } diff --git a/NevisExampleApp/Interaction/Password/PasswordEnroller.swift b/NevisExampleApp/Interaction/Password/PasswordEnroller.swift index 709a31e..1bfcc9e 100644 --- a/NevisExampleApp/Interaction/Password/PasswordEnroller.swift +++ b/NevisExampleApp/Interaction/Password/PasswordEnroller.swift @@ -51,6 +51,6 @@ extension PasswordEnrollerImpl: PasswordEnroller { /// You can add custom Password policy by overriding the `passwordPolicy` getter. // func passwordPolicy() -> PasswordPolicy { -// // custom PinPolicy implementation +// // custom PasswordPolicy implementation // } } diff --git a/NevisExampleApp/Screens/Credential/CredentialPresenter.swift b/NevisExampleApp/Screens/Credential/CredentialPresenter.swift index 97c44c1..759e6ee 100644 --- a/NevisExampleApp/Screens/Credential/CredentialPresenter.swift +++ b/NevisExampleApp/Screens/Credential/CredentialPresenter.swift @@ -8,19 +8,20 @@ import NevisMobileAuthentication // MARK: - Navigation +/// Navigation parameter of the Credential view. protocol CredentialParameter: NavigationParameterizable {} -/// Navigation parameter of the Pin view. +/// Navigation parameter of the Credential view in case of PIN authenticator. enum PinParameter: CredentialParameter { - /// Represents Pin enrollment - /// . + /// Represents PIN enrollment. + /// /// - Parameters: /// - lastRecoverableError: The object that informs that an error occurred during PIN enrollment. /// - handler: The PIN enrollment handler. case enrollment(lastRecoverableError: PinEnrollmentError?, handler: PinEnrollmentHandler) - /// Represents Pin verification. + /// Represents PIN verification. /// /// - Parameters: /// - protectionStatus: The object describing the PIN authenticator protection status. @@ -30,7 +31,7 @@ enum PinParameter: CredentialParameter { lastRecoverableError: PinUserVerificationError?, handler: PinUserVerificationHandler) - /// Represents Pin change. + /// Represents PIN change. /// /// - Parameters: /// - protectionStatus: The object describing the PIN authenticator protection status. @@ -41,10 +42,10 @@ enum PinParameter: CredentialParameter { handler: PinChangeHandler) } -/// Navigation parameter of the Password view. +/// Navigation parameter of the Credential view in case of Password authenticator. enum PasswordParameter: CredentialParameter { - /// Represents Password enrollment - /// . + /// Represents Password enrollment. + /// /// - Parameters: /// - lastRecoverableError: The object that informs that an error occurred during Password enrollment. /// - handler: The Password enrollment handler. @@ -74,12 +75,12 @@ enum PasswordParameter: CredentialParameter { // MARK: - Presenter -/// Presenter of Pin view. +/// Presenter of Credential view. final class CredentialPresenter { /// Available credential operations. enum CredentialOperation { - /// Wnrollment operation. + /// Enrollment operation. case enrollment /// Change operation. case credentialChange @@ -235,7 +236,7 @@ extension CredentialPresenter { /// Returns the actual credential type. /// /// - Returns: The actual credential type. - func getCredentialTypes() -> AuthenticatorAaid { + func getCredentialType() -> AuthenticatorAaid { credentialType } diff --git a/NevisExampleApp/Screens/Credential/CredentialScreen.swift b/NevisExampleApp/Screens/Credential/CredentialScreen.swift index 84e2e9b..7d5324f 100644 --- a/NevisExampleApp/Screens/Credential/CredentialScreen.swift +++ b/NevisExampleApp/Screens/Credential/CredentialScreen.swift @@ -135,8 +135,8 @@ private extension CredentialScreen { oldCredentialField.do { addItem($0, topSpacing: 16) $0.setHeight(with: 40) - $0.placeholder = presenter.getCredentialTypes() == .Pin ? L10n.Credential.Pin.oldPinPlaceholder : L10n.Credential.Password.oldPasswordPlaceholder - $0.keyboardType = presenter.getCredentialTypes() == .Pin ? .numberPad : .default + $0.placeholder = presenter.getCredentialType() == .Pin ? L10n.Credential.Pin.oldPinPlaceholder : L10n.Credential.Password.oldPasswordPlaceholder + $0.keyboardType = presenter.getCredentialType() == .Pin ? .numberPad : .default $0.isSecureTextEntry = true $0.inputAccessoryView = keyboardToolbar $0.superview?.isHidden = presenter.getOperation() != .credentialChange @@ -147,8 +147,8 @@ private extension CredentialScreen { credentialField.do { addItem($0, topSpacing: 16) $0.setHeight(with: 40) - $0.placeholder = presenter.getCredentialTypes() == .Pin ? L10n.Credential.Pin.pinPlaceholder : L10n.Credential.Password.passwordPlaceholder - $0.keyboardType = presenter.getCredentialTypes() == .Pin ? .numberPad : .default + $0.placeholder = presenter.getCredentialType() == .Pin ? L10n.Credential.Pin.pinPlaceholder : L10n.Credential.Password.passwordPlaceholder + $0.keyboardType = presenter.getCredentialType() == .Pin ? .numberPad : .default $0.isSecureTextEntry = true $0.inputAccessoryView = keyboardToolbar } @@ -192,7 +192,7 @@ private extension CredentialScreen { } } -// MARK: - PinView +// MARK: - CredentialView /// :nodoc: extension CredentialScreen: CredentialView { @@ -217,12 +217,12 @@ private extension CredentialScreen { @objc func confirm() { if presenter.getOperation() == .credentialChange, oldCredentialField.text.isEmptyOrNil { - errorLabel.text = presenter.getCredentialTypes() == .Pin ? L10n.Credential.Pin.missingOldPin : L10n.Credential.Password.missingOldPassword + errorLabel.text = presenter.getCredentialType() == .Pin ? L10n.Credential.Pin.missingOldPin : L10n.Credential.Password.missingOldPassword return } guard let credential = credentialField.text, !credential.isEmpty else { - errorLabel.text = presenter.getCredentialTypes() == .Pin ? L10n.Credential.Pin.missingPin : L10n.Credential.Password.missingPassword + errorLabel.text = presenter.getCredentialType() == .Pin ? L10n.Credential.Pin.missingPin : L10n.Credential.Password.missingPassword return }