IOS-1542 Rename methods, comment them. IOS-1542
authorDirk Zimmermann <dz@pep.security>
Tue, 07 May 2019 16:12:52 +0200
branchIOS-1542
changeset 8513091acae7b422
parent 8512 5af419b9a093
child 8514 c206dd336c3f
IOS-1542 Rename methods, comment them.
pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift
     1.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue May 07 16:12:52 2019 +0200
     1.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue May 07 16:12:52 2019 +0200
     1.3 @@ -245,7 +245,7 @@
     1.4                  password = nil
     1.5              }
     1.6  
     1.7 -            showSpinner()
     1.8 +            showSpinnerAndDisableUI()
     1.9              viewModel?.update(loginName: validated.loginName, name: validated.accountName,
    1.10                                password: password, imap: imap, smtp: smtp)
    1.11  
    1.12 @@ -307,7 +307,7 @@
    1.13  extension AccountSettingsTableViewController: AccountVerificationResultDelegate {
    1.14      func didVerify(result: AccountVerificationResult) {
    1.15          GCD.onMain() {
    1.16 -            self.hideSpinner()
    1.17 +            self.hideSpinnerAndEnableUI()
    1.18              switch result {
    1.19              case .ok:
    1.20                  self.navigationController?.popViewController(animated: true)
    1.21 @@ -345,7 +345,9 @@
    1.22  // MARK: - SPINNER
    1.23  
    1.24  extension AccountSettingsTableViewController {
    1.25 -    private func showSpinner() {
    1.26 +    /// Shows the spinner and disables UI parts that could lead to
    1.27 +    /// reentrant verifications.
    1.28 +    private func showSpinnerAndDisableUI() {
    1.29          spinner.center =
    1.30              CGPoint(x: tableView.frame.width / 2,
    1.31                      y:
    1.32 @@ -356,7 +358,8 @@
    1.33          spinner.startAnimating()
    1.34      }
    1.35  
    1.36 -    private func hideSpinner() {
    1.37 +    /// Hides the spinner and enables all UI elements again.
    1.38 +    private func hideSpinnerAndEnableUI() {
    1.39          tableView.isUserInteractionEnabled = true
    1.40          spinner.stopAnimating()
    1.41      }