From d8ef94a13d3c15ee008ebd3c12af55b8f557dbf1 Mon Sep 17 00:00:00 2001 From: Mauro Torres Mejia Date: Thu, 20 Apr 2017 15:34:45 +0200 Subject: [PATCH] Allow to pass new configuration when presenting passcode --- PasscodeLock/PasscodeLockPresenter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PasscodeLock/PasscodeLockPresenter.swift b/PasscodeLock/PasscodeLockPresenter.swift index 1967290f..681402e9 100644 --- a/PasscodeLock/PasscodeLockPresenter.swift +++ b/PasscodeLock/PasscodeLockPresenter.swift @@ -82,7 +82,7 @@ public class PasscodeLockPresenter { self.init(mainWindow: window, configuration: configuration, viewController: passcodeLockVC) } - public func presentPasscodeLock(withImage image: UIImage? = nil, andStrings stringsToShow: StringsToBeDisplayed? = nil, tintColor: UIColor?, font: UIFont?, dismissCompletionBlock: (() -> Void)? = nil) { + public func presentPasscodeLock(withImage image: UIImage? = nil, configuration config: PasscodeLockConfigurationType? = nil, andStrings stringsToShow: StringsToBeDisplayed? = nil, tintColor: UIColor?, font: UIFont?, dismissCompletionBlock: (() -> Void)? = nil) { guard passcodeConfiguration.repository.hasPasscode else { return } guard !isPasscodePresented else { return } @@ -95,7 +95,7 @@ public class PasscodeLockPresenter { mainWindow?.windowLevel = 1 mainWindow?.endEditing(true) - let passcodeLockVC = PasscodeLockViewController(state: .EnterPasscode, configuration: passcodeConfiguration, stringsToShow: stringsToShow, tintColor: tintColor, font: font) + let passcodeLockVC = PasscodeLockViewController(state: .EnterPasscode, configuration: (config ?? passcodeConfiguration), stringsToShow: stringsToShow, tintColor: tintColor, font: font) if (image != nil) { passcodeLockVC.customImage = image }