IOS-1542 IBOutlet for done button. IOS-1542
authorDirk Zimmermann <dz@pep.security>
Tue, 07 May 2019 16:12:52 +0200
branchIOS-1542
changeset 8515b62aeaa96238
parent 8514 c206dd336c3f
child 8519 3a5b50f22d85
IOS-1542 IBOutlet for done button.
pEpForiOS/Base.lproj/Settings.storyboard
pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift
     1.1 --- a/pEpForiOS/Base.lproj/Settings.storyboard	Tue May 07 16:12:52 2019 +0200
     1.2 +++ b/pEpForiOS/Base.lproj/Settings.storyboard	Tue May 07 16:12:52 2019 +0200
     1.3 @@ -1,11 +1,11 @@
     1.4  <?xml version="1.0" encoding="UTF-8"?>
     1.5 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="cPx-YX-3ty">
     1.6 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="cPx-YX-3ty">
     1.7      <device id="retina4_7" orientation="portrait">
     1.8          <adaptation id="fullscreen"/>
     1.9      </device>
    1.10      <dependencies>
    1.11          <deployment identifier="iOS"/>
    1.12 -        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
    1.13 +        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
    1.14          <capability name="Safe area layout guides" minToolsVersion="9.0"/>
    1.15          <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    1.16      </dependencies>
    1.17 @@ -651,6 +651,7 @@
    1.18                      <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
    1.19                      <simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
    1.20                      <connections>
    1.21 +                        <outlet property="doneButton" destination="Xy6-Rf-YDv" id="twm-qo-BhD"/>
    1.22                          <outlet property="emailTextfield" destination="FIa-wa-uSF" id="RVW-cY-4Ny"/>
    1.23                          <outlet property="imapPortTextfield" destination="ukB-K0-MMG" id="rGA-tC-CYA"/>
    1.24                          <outlet property="imapSecurityTextfield" destination="rCJ-UW-Jmn" id="Vz4-6T-rdl"/>
     2.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue May 07 16:12:52 2019 +0200
     2.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Tue May 07 16:12:52 2019 +0200
     2.3 @@ -27,6 +27,8 @@
     2.4      @IBOutlet weak var passwordTableViewCell: UITableViewCell!
     2.5      @IBOutlet weak var oauth2TableViewCell: UITableViewCell!
     2.6      @IBOutlet weak var oauth2ActivityIndicator: UIActivityIndicatorView!
     2.7 +    @IBOutlet weak var doneButton: UIBarButtonItem!
     2.8 +
     2.9  
    2.10      private let spinner: UIActivityIndicatorView = {
    2.11          let createe = UIActivityIndicatorView()
    2.12 @@ -50,10 +52,6 @@
    2.13       */
    2.14      var oauth2ReauthIndexPath: IndexPath?
    2.15  
    2.16 -    /// The last button item that triggered a verification.
    2.17 -    /// One of the UI elements that should get disabled during verification.
    2.18 -    var doneButton: UIBarButtonItem? = nil
    2.19 -    
    2.20       override func viewDidLoad() {
    2.21          super.viewDidLoad()
    2.22          configureView()
    2.23 @@ -250,7 +248,7 @@
    2.24                  password = nil
    2.25              }
    2.26  
    2.27 -            showSpinnerAndDisableUI(sender: sender)
    2.28 +            showSpinnerAndDisableUI()
    2.29              viewModel?.update(loginName: validated.loginName, name: validated.accountName,
    2.30                                password: password, imap: imap, smtp: smtp)
    2.31  
    2.32 @@ -352,9 +350,8 @@
    2.33  extension AccountSettingsTableViewController {
    2.34      /// Shows the spinner and disables UI parts that could lead to
    2.35      /// launching another verification while one is already in process.
    2.36 -    private func showSpinnerAndDisableUI(sender: UIBarButtonItem) {
    2.37 -        doneButton = sender
    2.38 -        sender.isEnabled = false
    2.39 +    private func showSpinnerAndDisableUI() {
    2.40 +        doneButton.isEnabled = false
    2.41  
    2.42          spinner.center =
    2.43              CGPoint(x: tableView.frame.width / 2,
    2.44 @@ -368,7 +365,7 @@
    2.45  
    2.46      /// Hides the spinner and enables all UI elements again.
    2.47      private func hideSpinnerAndEnableUI() {
    2.48 -        doneButton?.isEnabled = true
    2.49 +        doneButton.isEnabled = true
    2.50          tableView.isUserInteractionEnabled = true
    2.51          spinner.stopAnimating()
    2.52      }