Format code with SwiftFormat

This commit is contained in:
Danny Moesch 2021-01-31 13:17:37 +01:00 committed by Mingshen Sun
parent 4d6c77371d
commit ad4ed9419e
16 changed files with 49 additions and 49 deletions

View file

@ -36,7 +36,7 @@ class AddPasswordTableViewController: PasswordEditorTableViewController {
}
@IBAction
private func cancel(_ sender: Any) {
private func cancel(_: Any) {
navigationController?.popViewController(animated: true)
}

View file

@ -79,11 +79,11 @@ class AdvancedSettingsTableViewController: UITableViewController {
}
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, estimatedHeightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}

View file

@ -115,11 +115,11 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo
}
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, estimatedHeightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}

View file

@ -105,11 +105,11 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA
tableView.deselectRow(at: indexPath, animated: true)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, estimatedHeightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}

View file

@ -86,7 +86,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
}
@objc
private func decryptThenShowPasswordSelector(_ sender: Any) {
private func decryptThenShowPasswordSelector(_: Any) {
decryptThenShowPassword()
}

View file

@ -1,6 +1,6 @@
import UIKit
import passKit
import SVProgressHUD
import UIKit
extension UIStoryboard {
static var passwordNavigationViewController: PasswordNavigationViewController {
@ -148,7 +148,7 @@ class PasswordNavigationViewController: UIViewController {
navigationBar.addGestureRecognizer(tapNavigationBarGestureRecognizer)
}
private func isRootViewController () -> Bool {
private func isRootViewController() -> Bool {
navigationController?.viewControllers.count == 1
}
@ -258,11 +258,11 @@ extension PasswordNavigationViewController: UITableViewDelegate {
}
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
func tableView(_: UITableView, estimatedHeightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
}
@ -282,7 +282,7 @@ extension PasswordNavigationViewController {
}
}
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
override func shouldPerformSegue(withIdentifier identifier: String, sender _: Any?) -> Bool {
if identifier == "showPasswordDetail" {
guard PGPAgent.shared.isPrepared else {
Utils.alert(title: "CannotShowPassword".localize(), message: "PgpKeyNotSet.".localize(), controller: self)
@ -369,7 +369,7 @@ extension PasswordNavigationViewController: UISearchBarDelegate {
cancelSearch()
}
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
func searchBarTextDidEndEditing(_: UISearchBar) {
cancelSearch()
}

View file

@ -140,11 +140,11 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
tableView.deselectRow(at: indexPath, animated: true)
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, heightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
override func tableView(_: UITableView, estimatedHeightForRowAt _: IndexPath) -> CGFloat {
UITableView.automaticDimension
}

View file

@ -1,6 +1,6 @@
import UIKit
import passKit
import SVProgressHUD
import UIKit
class PasswordManager {
weak var viewController: UIViewController?

View file

@ -6,8 +6,8 @@
// Copyright © 2021 Bob Sun. All rights reserved.
//
import UIKit
import passKit
import UIKit
struct Section {
var title: String
@ -22,19 +22,19 @@ class PasswordNavigationDataSource: NSObject, UITableViewDataSource {
let hideSectionHeaderThreshold = 6
init(entries: [PasswordTableEntry] = []) {
sections = buildSections(from: entries)
filteredSections = sections
self.sections = buildSections(from: entries)
self.filteredSections = sections
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
func tableView(_: UITableView, numberOfRowsInSection section: Int) -> Int {
filteredSections[section].entries.count
}
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
func tableView(_: UITableView, titleForHeaderInSection section: Int) -> String? {
showSectionTitles() ? filteredSections[section].title : nil
}
func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int {
func tableView(_: UITableView, sectionForSectionIndexTitle _: String, at index: Int) -> Int {
index
}
@ -45,7 +45,7 @@ class PasswordNavigationDataSource: NSObject, UITableViewDataSource {
return cell
}
func numberOfSections(in tableView: UITableView) -> Int {
func numberOfSections(in _: UITableView) -> Int {
filteredSections.count
}