diff --git a/pass/Base.lproj/Main.storyboard b/pass/Base.lproj/Main.storyboard index 2bcb803..2eea95a 100644 --- a/pass/Base.lproj/Main.storyboard +++ b/pass/Base.lproj/Main.storyboard @@ -409,12 +409,12 @@ - + - @@ -441,12 +441,12 @@ - + - + - + @@ -490,7 +490,6 @@ - diff --git a/pass/Controllers/AdvancedSettingsTableViewController.swift b/pass/Controllers/AdvancedSettingsTableViewController.swift index bab8141..b251d44 100644 --- a/pass/Controllers/AdvancedSettingsTableViewController.swift +++ b/pass/Controllers/AdvancedSettingsTableViewController.swift @@ -79,6 +79,14 @@ class AdvancedSettingsTableViewController: UITableViewController { } } + override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + + override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + @objc func encryptInASCIIArmoredAction(_: Any?) { Defaults.encryptInArmored = encryptInASCIIArmoredSwitch.isOn diff --git a/pass/Controllers/BasicStaticTableViewController.swift b/pass/Controllers/BasicStaticTableViewController.swift index f87dcfc..8be1772 100644 --- a/pass/Controllers/BasicStaticTableViewController.swift +++ b/pass/Controllers/BasicStaticTableViewController.swift @@ -115,6 +115,14 @@ class BasicStaticTableViewController: UITableViewController, MFMailComposeViewCo } } + override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + + override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + func sendEmail(toRecipients recipients: [String], subject: String) { let mailVC = MFMailComposeViewController() mailVC.mailComposeDelegate = self diff --git a/pass/Controllers/GeneralSettingsTableViewController.swift b/pass/Controllers/GeneralSettingsTableViewController.swift index 4d8e7a7..374cd1a 100644 --- a/pass/Controllers/GeneralSettingsTableViewController.swift +++ b/pass/Controllers/GeneralSettingsTableViewController.swift @@ -95,9 +95,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { hideUnknownSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hideUnknownSwitch.bounds.width, height: hideUnknownSwitch.bounds.height) detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height) detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHideUnknownSwitchDetailButton(_:)), for: UIControl.Event.touchDown) - let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideUnknownSwitch.bounds.width + 10, height: hideUnknownSwitch.bounds.height)) + let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideUnknownSwitch.bounds.width + 10, height: cell.contentView.bounds.height)) accessoryView.addSubview(detailButton) accessoryView.addSubview(hideUnknownSwitch) + hideUnknownSwitch.center.y = accessoryView.center.y + detailButton.center.y = accessoryView.center.y cell.accessoryView = accessoryView cell.selectionStyle = .none hideUnknownSwitch.isOn = Defaults.isHideUnknownOn @@ -107,9 +109,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { hideOTPSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hideOTPSwitch.bounds.width, height: hideOTPSwitch.bounds.height) detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height) detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHideOTPSwitchDetailButton(_:)), for: UIControl.Event.touchDown) - let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideOTPSwitch.bounds.width + 10, height: hideOTPSwitch.bounds.height)) + let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hideOTPSwitch.bounds.width + 10, height: cell.contentView.bounds.height)) accessoryView.addSubview(detailButton) accessoryView.addSubview(hideOTPSwitch) + hideOTPSwitch.center.y = accessoryView.center.y + detailButton.center.y = accessoryView.center.y cell.accessoryView = accessoryView cell.selectionStyle = .none hideOTPSwitch.isOn = Defaults.isHideOTPOn @@ -131,9 +135,11 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { hidePasswordImagesSwitch.frame = CGRect(x: detailButton.bounds.width + 10, y: 0, width: hidePasswordImagesSwitch.bounds.width, height: hidePasswordImagesSwitch.bounds.height) detailButton.frame = CGRect(x: 0, y: 5, width: detailButton.bounds.width, height: detailButton.bounds.height) detailButton.addTarget(self, action: #selector(GeneralSettingsTableViewController.tapHidePasswordImagesSwitchDetailButton(_:)), for: UIControl.Event.touchDown) - let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hidePasswordImagesSwitch.bounds.width + 10, height: hidePasswordImagesSwitch.bounds.height)) + let accessoryView = UIView(frame: CGRect(x: 0, y: 0, width: detailButton.bounds.width + hidePasswordImagesSwitch.bounds.width + 10, height: cell.contentView.bounds.height)) accessoryView.addSubview(detailButton) accessoryView.addSubview(hidePasswordImagesSwitch) + hidePasswordImagesSwitch.center.y = accessoryView.center.y + detailButton.center.y = accessoryView.center.y cell.accessoryView = accessoryView cell.selectionStyle = .none hidePasswordImagesSwitch.isOn = Defaults.isHidePasswordImagesOn diff --git a/pass/Controllers/GitRepositorySettingsTableViewController.swift b/pass/Controllers/GitRepositorySettingsTableViewController.swift index fff34c0..5cbce88 100644 --- a/pass/Controllers/GitRepositorySettingsTableViewController.swift +++ b/pass/Controllers/GitRepositorySettingsTableViewController.swift @@ -19,7 +19,6 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA @IBOutlet var authSSHKeyCell: UITableViewCell! @IBOutlet var authPasswordCell: UITableViewCell! @IBOutlet var gitURLCell: UITableViewCell! - @IBOutlet var gitRepositoryURLTabelViewCell: UITableViewCell! // MARK: - Properties @@ -106,6 +105,14 @@ class GitRepositorySettingsTableViewController: UITableViewController, PasswordA tableView.deselectRow(at: indexPath, animated: true) } + override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + + override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + // MARK: - Segue Handlers @IBAction diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index ee16352..aead0b9 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -366,6 +366,14 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV return cell } + func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + private func getPasswordEntry(by indexPath: IndexPath) -> PasswordTableEntry { sections[indexPath.section].entries[indexPath.row] } diff --git a/pass/Controllers/SettingsTableViewController.swift b/pass/Controllers/SettingsTableViewController.swift index 3a3f45d..c076bb0 100644 --- a/pass/Controllers/SettingsTableViewController.swift +++ b/pass/Controllers/SettingsTableViewController.swift @@ -140,6 +140,14 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele tableView.deselectRow(at: indexPath, animated: true) } + override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + + override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { + UITableView.automaticDimension + } + func showPGPKeyActionSheet() { let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) optionMenu.addAction(