An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/Trust/Lock/ViewModels/LockViewModel.swift

21 lines
583 B

// Copyright SIX DAY LLC. All rights reserved.
import UIKit
class LockViewModel {
private let lock = Lock()
func charCount() -> Int {
//This step is required for old clients to support 4 digit passcode.
var count = 0
if lock.isPasscodeSet() {
count = lock.currentPasscode()!.count
} else {
count = 6
}
return count
}
func passcodeAttemptLimit() -> Int {
//If max attempt limit is rached we should give only 1 attempt.
return lock.incorrectMaxAttemptTimeIsSet() ? 1 : 5
}
}