diff --git a/Sources/Controllers/PassCode/Model/PassCodeHolder.swift b/Sources/Controllers/PassCode/Model/PassCodeHolder.swift index 4780bba..874bd7a 100644 --- a/Sources/Controllers/PassCode/Model/PassCodeHolder.swift +++ b/Sources/Controllers/PassCode/Model/PassCodeHolder.swift @@ -41,7 +41,7 @@ public extension PassCodeHolderProtocol { /// Holds information about pass codes during pass code creation process public class PassCodeHolderCreate: PassCodeHolderProtocol { - public let type: PassCodeControllerType = .create + public let type: PassCodeOperationType = .create private var firstPassCode: String? private var secondPassCode: String? @@ -95,7 +95,7 @@ public class PassCodeHolderCreate: PassCodeHolderProtocol { /// Holds information about pass code during pass code entering process public class PassCodeHolderEnter: PassCodeHolderProtocol { - public let type: PassCodeControllerType = .enter + public let type: PassCodeOperationType = .enter public let enterStep: PassCodeControllerState = .enter public var shouldValidate: Bool { @@ -125,7 +125,7 @@ public class PassCodeHolderEnter: PassCodeHolderProtocol { /// Holds information about pass codes during pass code changing process public class PassCodeHolderChange: PassCodeHolderProtocol { - public let type: PassCodeControllerType = .change + public let type: PassCodeOperationType = .change private var oldPassCode: String? private var newFirstPassCode: String? diff --git a/Sources/Controllers/PassCode/Model/PassCodeHolderProtocol.swift b/Sources/Controllers/PassCode/Model/PassCodeHolderProtocol.swift index d8bcf6c..0537f08 100644 --- a/Sources/Controllers/PassCode/Model/PassCodeHolderProtocol.swift +++ b/Sources/Controllers/PassCode/Model/PassCodeHolderProtocol.swift @@ -25,7 +25,7 @@ public protocol PassCodeHolderProtocol { /// Type of operation with pass code - var type: PassCodeControllerType { get } + var type: PassCodeOperationType { get } /// Operation step var enterStep: PassCodeControllerState { get } @@ -54,7 +54,7 @@ public class PassCodeHolderBuilder { - parameter type: type of pass code controller - returns: pass code information holder, specific by type */ - public static func build(with type: PassCodeControllerType) -> PassCodeHolderProtocol { + public static func build(with type: PassCodeOperationType) -> PassCodeHolderProtocol { switch type { case .create: return PassCodeHolderCreate() diff --git a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift index 4fcc766..61032b9 100644 --- a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift +++ b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift @@ -32,7 +32,7 @@ public enum PinImageType { } /// Pass code operation type -public enum PassCodeControllerType { +public enum PassCodeOperationType { case create case enter case change diff --git a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift index de5533b..005f5c6 100644 --- a/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift +++ b/Sources/Controllers/PassCode/ViewModel/BasePassCodeViewModel.swift @@ -33,7 +33,7 @@ public enum PassCodeAuthType { /// Base view model for passCodeViewController open class BasePassCodeViewModel: BaseViewModel { - public let controllerType: PassCodeControllerType + public let operationType: PassCodeOperationType public let disposeBag = DisposeBag() @@ -57,10 +57,10 @@ open class BasePassCodeViewModel: BaseViewModel { private var attemptsNumber = 0 - private lazy var passCodeHolder: PassCodeHolderProtocol = PassCodeHolderBuilder.build(with: self.controllerType) + private lazy var passCodeHolder: PassCodeHolderProtocol = PassCodeHolderBuilder.build(with: self.operationType) - public init(controllerType: PassCodeControllerType, passCodeConfiguration: PassCodeConfiguration) { - self.controllerType = controllerType + public init(operationType: PassCodeOperationType, passCodeConfiguration: PassCodeConfiguration) { + self.operationType = operationType self.passCodeConfiguration = passCodeConfiguration bindViewModel() @@ -95,7 +95,7 @@ open class BasePassCodeViewModel: BaseViewModel { public func reset() { passCodeText.value = nil validationResultHolder.value = nil - passCodeControllerStateVariable.value = controllerType == .change ? .oldEnter : .enter + passCodeControllerStateVariable.value = operationType == .change ? .oldEnter : .enter attemptsNumber = 0 passCodeHolder.reset() }