SearchBarContainer.swift 1.21 KB
//
//  SearchBarSpace.swift
//  browser
//
//  Created by Artem Talko on 12.10.2023.
//
//MARK: Checked

import UIKit

final class SearchBarContainer: UIView {
    let searchBarView: SearchBarView = {
        let obj  = SearchBarView()
        obj.backgroundColor = .white
        obj.layer.cornerRadius = 10
        obj.layer.shadowColor = UIColor.black.withAlphaComponent(0.1).cgColor
        obj.layer.shadowOpacity = 1
        obj.layer.shadowRadius = 10
        obj.layer.shadowOffset = CGSize(width: 0, height: 4.sizeW)
        
        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(searchBarView)
        
        setupConstraints()
    }
    
    private func setupConstraints() {
        searchBarView.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(4.sizeH)
            make.leading.equalToSuperview().offset(16.sizeW)
            make.bottom.equalToSuperview().offset(-6.sizeH)
            make.trailing.equalToSuperview().offset(-16.sizeW)
        }
    }
}