RemoveAdvertTableViewCell.swift 2.07 KB
//
//  RemoveAdvertTableViewCell.swift
//  browser
//
//  Created by Artem Talko on 24.11.2023.
//

import UIKit

final class RemoveAdvertTableViewCell: UITableViewCell {
    static let cellID = String(describing: RemoveAdvertTableViewCell.self)
    
       let advantagesCellLabel: UILabel = {
           let obj = UILabel()
           obj.font = FontConstants.regularFont_14
           
           return obj
       }()
       
       private let advantagesCellImage: UIImageView = {
           let obj = UIImageView()
           let checkmarkImg = UIImage(systemName: "circle.fill")?.withTintColor(.white, renderingMode: .alwaysOriginal)
           obj.image = checkmarkImg
           obj.contentMode = .scaleAspectFit
           
           return obj
       }()
       
       override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
           super.init(style: style, reuseIdentifier: reuseIdentifier)
           
           setup()
       }
       
       required init?(coder: NSCoder) {
           fatalError("init(coder:) has not been implemented")
       }
       
       private func setup() {
           selectionStyle = .none
           backgroundColor = .clear
           contentView.addSubview(advantagesCellLabel)
           contentView.addSubview(advantagesCellImage)
         
           setupConstraints()
       }
       
       private func setupConstraints() {
           advantagesCellLabel.snp.makeConstraints { make in
               make.top.equalToSuperview().inset(5.sizeH)
               make.leading.equalTo(advantagesCellImage.snp.trailing)
               make.bottom.equalToSuperview().inset(5.sizeH)
               make.trailing.equalToSuperview()
           }
           
           advantagesCellImage.snp.makeConstraints { make in
               make.top.equalToSuperview().inset(6.sizeH)
               make.leading.equalToSuperview()
               make.bottom.equalToSuperview().inset(10.sizeH)
               make.trailing.equalTo(advantagesCellLabel.snp.leading).offset(-8.sizeW)
               make.height.width.equalTo(12.sizeH)
           }
       }
}