Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion PasscodeLock/PasscodeLock/PasscodeLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ public class PasscodeLock: PasscodeLockType {
guard isTouchIDAllowed else { return }

let context = LAContext()
let reason = localizedStringFor("PasscodeLockTouchIDReason", comment: "TouchID authentication reason")
let reason: String
if let configReason = configuration.touchIdReason {
reason = configReason
} else {
reason = localizedStringFor("PasscodeLockTouchIDReason", comment: "TouchID authentication reason")
}

context.localizedFallbackTitle = localizedStringFor("PasscodeLockTouchIDButton", comment: "TouchID authentication fallback button")

Expand Down
1 change: 1 addition & 0 deletions PasscodeLock/Protocols/PasscodeLockConfigurationType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public protocol PasscodeLockConfigurationType {
var passcodeLength: Int {get}
var isTouchIDAllowed: Bool {get set}
var shouldRequestTouchIDImmediately: Bool {get}
var touchIdReason: String? {get set}
var maximumInccorectPasscodeAttempts: Int {get}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class FakePasscodeLockConfiguration: PasscodeLockConfigurationType {
var isTouchIDAllowed = false
let maximumInccorectPasscodeAttempts = 3
let shouldRequestTouchIDImmediately = false
var touchIdReason: String? = nil

init(repository: PasscodeRepositoryType) {

Expand Down