Use PasswordTableViewCell for all password entries

This commit is contained in:
Mingshen Sun 2021-01-05 20:54:51 -08:00
parent 3e3aca1c3c
commit 3ecb35e701
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 164 additions and 168 deletions

View file

@ -0,0 +1,29 @@
//
// PasswordCell.swift
// passAutoFillExtension
//
// Created by Sun, Mingshen on 12/31/20.
// Copyright © 2020 Bob Sun. All rights reserved.
//
import passKit
class PasswordTableViewCell: UITableViewCell {
func configure(with entry: PasswordTableEntry) {
textLabel?.font = UIFont.preferredFont(forTextStyle: .body)
textLabel?.text = entry.passwordEntity.synced ? entry.title : "\(entry.title)"
textLabel?.adjustsFontForContentSizeCategory = true
accessoryType = .none
detailTextLabel?.font = UIFont.preferredFont(forTextStyle: .footnote)
detailTextLabel?.adjustsFontForContentSizeCategory = true
detailTextLabel?.text = entry.categoryText
if entry.isDir {
accessoryType = .disclosureIndicator
textLabel?.font = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .medium)
detailTextLabel?.font = UIFont.preferredFont(forTextStyle: .body)
detailTextLabel?.text = "\(entry.passwordEntity.children?.count ?? 0)"
}
}
}