IOS-1716 toggling extraKeysEditability up & running IOS-1716
authorbuff <andreas@pep-project.org>
Tue, 13 Aug 2019 14:37:48 +0200
branchIOS-1716
changeset 966612ee11079879
parent 9665 a739423ea8bb
child 9667 9ff0ad8d23d2
IOS-1716 toggling extraKeysEditability up & running
pEpForiOS/UI/Settings/SettingsTableViewController.swift
     1.1 --- a/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Tue Aug 13 14:26:26 2019 +0200
     1.2 +++ b/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Tue Aug 13 14:37:48 2019 +0200
     1.3 @@ -47,24 +47,6 @@
     1.4          updateModel()
     1.5      }
     1.6  
     1.7 -    //BUFF: move to extension
     1.8 -
     1.9 -    /// Adds easter egg gesture to [en|dis]able the editability of extra keys
    1.10 -    private func addExtraKeysEditabilityToggleGesture() {
    1.11 -        let gestureRecogniser =
    1.12 -            UITapGestureRecognizer(target: self,
    1.13 -                                   action: Selector(("extraKeysEditabilityToggleGestureTriggered")))
    1.14 -        gestureRecogniser.numberOfTapsRequired = 6
    1.15 -        gestureRecogniser.numberOfTouchesRequired = 3
    1.16 -        tableView.addGestureRecognizer(gestureRecogniser)
    1.17 -    }
    1.18 -
    1.19 -    private func extraKeysEditabilityToggleGestureTriggered() {
    1.20 -        viewModel.handleExtryKeysEditabilityGestureTriggered()
    1.21 -    }
    1.22 -
    1.23 -
    1.24 -
    1.25      override func viewWillDisappear(_ animated: Bool) {
    1.26          self.navigationController?.setToolbarHidden(oldToolbarStatus, animated: false)
    1.27          guard let isIphone = splitViewController?.isCollapsed else {
    1.28 @@ -339,6 +321,26 @@
    1.29      }
    1.30  }
    1.31  
    1.32 +// MARK: - Extra Keys
    1.33 +
    1.34 +extension SettingsTableViewController {
    1.35 +    
    1.36 +    /// Adds easter egg gesture to [en|dis]able the editability of extra keys
    1.37 +    private func addExtraKeysEditabilityToggleGesture() {
    1.38 +        let gestureRecogniser =
    1.39 +            UITapGestureRecognizer(target: self,
    1.40 +                                   action: #selector(extraKeysEditabilityToggleGestureTriggered))
    1.41 +        gestureRecogniser.numberOfTapsRequired = 6
    1.42 +        gestureRecogniser.numberOfTouchesRequired = 3
    1.43 +        tableView.addGestureRecognizer(gestureRecogniser)
    1.44 +    }
    1.45 +
    1.46 +    @objc // @objc is required for selector
    1.47 +    private func extraKeysEditabilityToggleGestureTriggered() {
    1.48 +        viewModel.handleExtryKeysEditabilityGestureTriggered()
    1.49 +    }
    1.50 +}
    1.51 +
    1.52  // MARK: - SettingsViewModelDelegate
    1.53  
    1.54  extension SettingsTableViewController: SettingsViewModelDelegate {