diff --git a/Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift b/Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift index 49824bf4999..29891f4b464 100644 --- a/Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift +++ b/Client/Frontend/AuthenticationManager/PagingPasscodeViewController.swift @@ -7,6 +7,8 @@ private let PaneSwipeDuration: TimeInterval = 0.3 /// Base class for implementing a Passcode configuration screen with multiple 'panes'. class PagingPasscodeViewController: BasePasscodeViewController { + var completion: (() -> Void)? + fileprivate lazy var pager: UIScrollView = { let scrollView = UIScrollView() scrollView.isPagingEnabled = true @@ -46,6 +48,7 @@ class PagingPasscodeViewController: BasePasscodeViewController { override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) self.view.endEditing(true) + completion?() } } diff --git a/Client/Frontend/Settings/PasscodeSettingsViewController.swift b/Client/Frontend/Settings/PasscodeSettingsViewController.swift index 50426e95dd6..bc890b0e389 100644 --- a/Client/Frontend/Settings/PasscodeSettingsViewController.swift +++ b/Client/Frontend/Settings/PasscodeSettingsViewController.swift @@ -41,6 +41,7 @@ class PasscodeSettingsViewController: TableViewController { Row(text: Strings.AuthenticationTurnOffPasscode, selection: { [unowned self] in let setupPasscodeController = RemovePasscodeViewController() + setupPasscodeController.completion = self.reloadSections let container = UINavigationController(rootViewController: setupPasscodeController) self.present(container, animated: true) }, @@ -49,6 +50,7 @@ class PasscodeSettingsViewController: TableViewController { Row(text: Strings.AuthenticationChangePasscode, selection: { [unowned self] in let changePasscodeController = ChangePasscodeViewController() + changePasscodeController.completion = self.reloadSections let container = UINavigationController(rootViewController: changePasscodeController) self.present(container, animated: true) } @@ -80,6 +82,7 @@ class PasscodeSettingsViewController: TableViewController { Row(text: Strings.AuthenticationTurnOnPasscode, selection: { [unowned self] in let setupPasscodeController = SetupPasscodeViewController() + setupPasscodeController.completion = self.reloadSections let container = UINavigationController(rootViewController: setupPasscodeController) self.present(container, animated: true) },