From bf501c15bb2783738e233e0e1edc6c7d3dcdaa8f Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Sun, 2 Apr 2017 21:22:14 -0700 Subject: [PATCH] Delete unusable cell controller and corresponding UI, fix alignment issue --- pass.xcodeproj/project.pbxproj | 8 --- .../Controllers/PasswordsViewController.swift | 15 +++--- .../PasswordWithFolderTableViewCell.swift | 27 ---------- .../Views/PasswordWithFolderTableViewCell.xib | 52 ------------------- 4 files changed, 9 insertions(+), 93 deletions(-) delete mode 100644 pass/Views/PasswordWithFolderTableViewCell.swift delete mode 100644 pass/Views/PasswordWithFolderTableViewCell.xib diff --git a/pass.xcodeproj/project.pbxproj b/pass.xcodeproj/project.pbxproj index fdf986e..12b0373 100644 --- a/pass.xcodeproj/project.pbxproj +++ b/pass.xcodeproj/project.pbxproj @@ -57,8 +57,6 @@ DCC441541E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC441531E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift */; }; DCDDEAB01E4639F300F68193 /* LabelTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCDDEAAF1E4639F300F68193 /* LabelTableViewCell.xib */; }; DCDDEAB31E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDDEAB11E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift */; }; - DCE6C2671E71261C003038C6 /* PasswordWithFolderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCE6C2651E71261C003038C6 /* PasswordWithFolderTableViewCell.swift */; }; - DCE6C2681E71261C003038C6 /* PasswordWithFolderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCE6C2661E71261C003038C6 /* PasswordWithFolderTableViewCell.xib */; }; DCFB779A1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77981E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift */; }; DCFB779B1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCFB77991E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib */; }; DCFB779E1E4F40C7008DE471 /* FillPasswordTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB779C1E4F40C7008DE471 /* FillPasswordTableViewCell.swift */; }; @@ -138,8 +136,6 @@ DCC441531E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitSSHKeyArmorSettingTableViewController.swift; sourceTree = ""; }; DCDDEAAF1E4639F300F68193 /* LabelTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LabelTableViewCell.xib; sourceTree = ""; }; DCDDEAB11E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordDetailTitleTableViewCell.swift; sourceTree = ""; }; - DCE6C2651E71261C003038C6 /* PasswordWithFolderTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordWithFolderTableViewCell.swift; sourceTree = ""; }; - DCE6C2661E71261C003038C6 /* PasswordWithFolderTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordWithFolderTableViewCell.xib; sourceTree = ""; }; DCFB77981E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TitleTextFieldTableViewCell.swift; sourceTree = ""; }; DCFB77991E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TitleTextFieldTableViewCell.xib; sourceTree = ""; }; DCFB779C1E4F40C7008DE471 /* FillPasswordTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FillPasswordTableViewCell.swift; sourceTree = ""; }; @@ -265,8 +261,6 @@ DC037CBD1E4ED4E100609409 /* TextViewTableViewCell.swift */, DC037CBE1E4ED4E100609409 /* TextViewTableViewCell.xib */, DCFB77AA1E503729008DE471 /* ContentTableViewCell.swift */, - DCE6C2651E71261C003038C6 /* PasswordWithFolderTableViewCell.swift */, - DCE6C2661E71261C003038C6 /* PasswordWithFolderTableViewCell.xib */, ); path = Views; sourceTree = ""; @@ -427,7 +421,6 @@ DCDDEAB01E4639F300F68193 /* LabelTableViewCell.xib in Resources */, DC917BDC1E2E8231000FDF54 /* Main.storyboard in Resources */, A2802BFA1E70813A00879216 /* SliderTableViewCell.xib in Resources */, - DCE6C2681E71261C003038C6 /* PasswordWithFolderTableViewCell.xib in Resources */, DCFB779B1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib in Resources */, DCFB779F1E4F40C7008DE471 /* FillPasswordTableViewCell.xib in Resources */, DC037CC01E4ED4E100609409 /* TextViewTableViewCell.xib in Resources */, @@ -531,7 +524,6 @@ DC5F385B1E56AADB00C69ACA /* PGPKeyArmorSettingTableViewController.swift in Sources */, A27424D91E7C35960093F436 /* NotificationNames.swift in Sources */, DCAAF7451E2FA66800AB94BC /* SettingsTableViewController.swift in Sources */, - DCE6C2671E71261C003038C6 /* PasswordWithFolderTableViewCell.swift in Sources */, DCFB77A71E502DF9008DE471 /* EditPasswordTableViewController.swift in Sources */, DCA0499A1E335CC800522E8F /* GitServerSettingTableViewController.swift in Sources */, DCDDEAB31E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift in Sources */, diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 2d221c7..defb6ec 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -219,20 +219,23 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV } else { cell.textLabel?.text = "\(entry.title)" cell.accessoryType = .disclosureIndicator + cell.detailTextLabel?.font = UIFont.preferredFont(forTextStyle: .body) cell.detailTextLabel?.text = "\(entry.passwordEntity?.children?.count ?? 0)" } return cell } else { - let passwordWithFolderCell = tableView.dequeueReusableCell(withIdentifier: "passwordWithFolderTableViewCell", for: indexPath) as! PasswordWithFolderTableViewCell + let cell = tableView.dequeueReusableCell(withIdentifier: "passwordTableViewCell", for: indexPath) let entry = getPasswordEntry(by: indexPath) if entry.passwordEntity!.synced { - passwordWithFolderCell.passwordLabel?.text = entry.title + cell.textLabel?.text = entry.title } else { - passwordWithFolderCell.passwordLabel?.text = "↻ \(entry.title)" + cell.textLabel?.text = "↻ \(entry.title)" } - passwordWithFolderCell.folderLabel.text = entry.passwordEntity?.getCategoryText() - passwordWithFolderCell.addGestureRecognizer(longPressGestureRecognizer) - return passwordWithFolderCell + cell.accessoryType = .none + cell.detailTextLabel?.font = UIFont.preferredFont(forTextStyle: .footnote) + cell.detailTextLabel?.text = entry.passwordEntity?.getCategoryText() + cell.addGestureRecognizer(longPressGestureRecognizer) + return cell } } diff --git a/pass/Views/PasswordWithFolderTableViewCell.swift b/pass/Views/PasswordWithFolderTableViewCell.swift deleted file mode 100644 index b1b9c1e..0000000 --- a/pass/Views/PasswordWithFolderTableViewCell.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// PasswordTableViewCell.swift -// pass -// -// Created by Mingshen Sun on 8/3/2017. -// Copyright © 2017 Bob Sun. All rights reserved. -// - -import UIKit - -class PasswordWithFolderTableViewCell: UITableViewCell { - - @IBOutlet weak var passwordLabel: UILabel! - @IBOutlet weak var folderLabel: UILabel! - - override func awakeFromNib() { - super.awakeFromNib() - // Initialization code - } - - override func setSelected(_ selected: Bool, animated: Bool) { - super.setSelected(selected, animated: animated) - - // Configure the view for the selected state - } - -} diff --git a/pass/Views/PasswordWithFolderTableViewCell.xib b/pass/Views/PasswordWithFolderTableViewCell.xib deleted file mode 100644 index cc13c37..0000000 --- a/pass/Views/PasswordWithFolderTableViewCell.xib +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -