PassCodeControllerType renamed

This commit is contained in:
Alexey Gerasimov 2018-10-22 15:44:17 +03:00
parent 36d8602e8f
commit c8a6000b25
4 changed files with 11 additions and 11 deletions

View File

@ -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?

View File

@ -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()

View File

@ -32,7 +32,7 @@ public enum PinImageType {
}
/// Pass code operation type
public enum PassCodeControllerType {
public enum PassCodeOperationType {
case create
case enter
case change

View File

@ -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()
}