Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Detail Wrapping #310

Merged
3 changes: 2 additions & 1 deletion Receipt/Sources/ListReceiptController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ final class ListReceiptController: UITableViewController {
listReceiptCell.createdOnLabel.isUserInteractionEnabled = false
listReceiptCell.currencyLabel.isUserInteractionEnabled = false
listReceiptCell.accessoryType = .disclosureIndicator
listReceiptCell.layoutIfNeeded()
}
return cell
}
Expand All @@ -100,7 +101,7 @@ final class ListReceiptController: UITableViewController {
}

override public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return Theme.Cell.height
return UITableView.automaticDimension
}

/// Returns title for header
Expand Down
3 changes: 2 additions & 1 deletion Receipt/Sources/ReceiptDetailController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ final class ReceiptDetailController: UITableViewController {
if let tableViewCell = cell as? ReceiptTransactionCell,
let transactionSection = section as? ReceiptDetailSectionTransactionData {
tableViewCell.configure(transactionSection.receipt)
tableViewCell.layoutIfNeeded()
}

case .details:
Expand Down Expand Up @@ -125,6 +126,6 @@ extension ReceiptDetailController {
}

override public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return indexPath.section == 0 ? Theme.Cell.height : Theme.Cell.smallHeight
return indexPath.section == 0 ? UITableView.automaticDimension : Theme.Cell.smallHeight
}
}
4 changes: 3 additions & 1 deletion Receipt/Sources/ReceiptTransactionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ final class ReceiptTransactionCell: UITableViewCell {
lazy var receiptTypeLabel: UILabel = {
let label = UILabel(frame: .zero)
label.accessibilityIdentifier = "receiptTransactionTypeLabel"
label.lineBreakMode = .byWordWrapping
label.numberOfLines = 0
label.allowTextSelection()
return label
}()
Expand Down Expand Up @@ -105,7 +107,7 @@ final class ReceiptTransactionCell: UITableViewCell {
stackView.axis = .horizontal
stackView.alignment = .center
stackView.distribution = .fill
stackView.spacing = 8
stackView.spacing = 2

stackView.addArrangedSubview(leftLabel)
stackView.addArrangedSubview(rightLabel)
Expand Down