Untitled

mail@pastecode.io avatar
unknown
swift
a year ago
1.9 kB
2
Indexable
Never
import UIKit
import SnapKit

class AccountClientCell: UITableViewCell {
    // MARK: - Properties
    private let subAccountFieldPicker: UIView = {
        let view = ItemsFieldPicker() // Replace ItemsFieldPicker with the actual custom view class if available.
        view.translatesAutoresizingMaskIntoConstraints = false
        view.backgroundColor = UIColor(red: 1, green: 0.75557024859999999, blue: 0.56747968689999995, alpha: 1)
        return view
    }()
    
    private let cellSeparatorView: UIView = {
        let view = UIView()
        view.translatesAutoresizingMaskIntoConstraints = false
        view.backgroundColor = UIColor.systemGroupedBackground
        return view
    }()
    
    // MARK: - Initialization
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    // MARK: - UI Setup
    private func setupUI() {
        contentView.addSubview(subAccountFieldPicker)
        contentView.addSubview(cellSeparatorView)
        
        subAccountFieldPicker.snp.makeConstraints { make in
            make.leading.equalToSuperview().offset(12)
            make.trailing.equalToSuperview().offset(-12)
            make.top.equalToSuperview().offset(5)
            make.bottom.equalTo(cellSeparatorView.snp.top).offset(-8)
            make.height.greaterThanOrEqualTo(30) // Add a minimum height constraint if needed
        }
        
        cellSeparatorView.snp.makeConstraints { make in
            make.leading.equalToSuperview()
            make.trailing.equalToSuperview()
            make.bottom.equalToSuperview()
            make.height.equalTo(1)
        }
    }
    
    // MARK: - Configuration
    // Add a method to configure the subAccountFieldPicker if needed
}