SettingView.swift 1.35 KB
//
//  SettingView.swift
//  browser
//
//  Created by Artem Talko on 26.09.2023.
//

import UIKit

final class SettingView: UIView {
    let backButton: UIButton = {
        let obj = UIButton()
        obj.setImage(UIImage(systemName: "arrow.left"), for: .normal)
        obj.contentMode = .scaleToFill
        return obj
    }()
    
    let settingTableView: UITableView = {
        let obj = UITableView()
        obj.isScrollEnabled = false
        obj.separatorStyle = .none
        return obj
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setup()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setup() {
        addSubview(settingTableView)
        addSubview(backButton)
        setupConstraints()
    }
    
    private func setupConstraints() {
        settingTableView.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(168.sizeH)
            make.bottom.equalToSuperview().offset(-100.sizeH)
            make.leading.trailing.equalToSuperview().inset(32.sizeW)
        }
        backButton.snp.makeConstraints { make in
            make.top.equalTo(safeAreaLayoutGuide.snp.top).offset(16.sizeH)
            make.height.equalTo(24.sizeH)
            make.leading.equalToSuperview().inset(16.sizeW)
        }
    }
}