SearchBarContainer.swift
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// SearchBarSpace.swift
// browser
//
// Created by Artem Talko on 12.10.2023.
//
import UIKit
final class SearchBarContainer: UIView {
let searchBarView: SearchBarView = {
let obj = SearchBarView()
obj.backgroundColor = ColorConstants.customLightBlue
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)
}
}
}