diff --git a/Sources/Earthquake Network/UI/EQNBaseContainerTableViewCell.swift b/Sources/Earthquake Network/UI/EQNBaseContainerTableViewCell.swift index bd554a1..9644904 100644 --- a/Sources/Earthquake Network/UI/EQNBaseContainerTableViewCell.swift +++ b/Sources/Earthquake Network/UI/EQNBaseContainerTableViewCell.swift @@ -20,8 +20,12 @@ extension CGFloat { static let cardVerticalSpacing: CGFloat = 10.0 } +@objc class EQNBaseContainerTableViewCell: UITableViewCell { - + + /// Inset to apply to enclosing table view. Used to adjust spacing around the cells (for instance, top space is smaller that the space between the cards) + @objc static let EdgeInsets: UIEdgeInsets = .init(top: CGFloat.cardHorizontalMargin - CGFloat.cardVerticalMargin, left: 0, bottom: 0, right: 0) + // MARK: - UI private lazy var internalContainerView: UIView = { @@ -46,11 +50,11 @@ class EQNBaseContainerTableViewCell: UITableViewCell { }() private lazy var headerLabel: UILabel = { - let label = EQNEdgeInsetLabel() + let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.backgroundColor = AppTheme.Colors.lightBlue - label.font = .systemFont(ofSize: 17.0, weight: .medium) - label.textColor = .white + label.textAlignment = .center + label.font = .preferredFont(forTextStyle: .title2) + label.textColor = AppTheme.shared.cardTextColor return label }() @@ -136,9 +140,9 @@ class EQNBaseContainerTableViewCell: UITableViewCell { if isHeaderVisible { containerView.addSubview(headerLabel) - headerLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true + headerLabel.topAnchor.constraint(equalTo: containerView.topAnchor, constant: .cardPadding).isActive = true headerLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true - headerLabel.heightAnchor.constraint(equalToConstant: 26.0).isActive = true + headerLabel.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true } else { containerView.addSubview(emptyTopView) emptyTopView.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true