refactor: Migrate AlertsPriorityServiceTableViewCell to code
This commit is contained in:
@@ -37,9 +37,15 @@ class EQNBaseContainerTableViewCell: UITableViewCell {
|
||||
label.textColor = .white
|
||||
return label
|
||||
}()
|
||||
|
||||
private lazy var emptyTopView: UIView = {
|
||||
let view = UIView(frame: .zero)
|
||||
view.backgroundColor = .clear
|
||||
return view
|
||||
}()
|
||||
|
||||
var topView: UIView {
|
||||
isHeaderVisible ? headerLabel : containerView
|
||||
isHeaderVisible ? headerLabel : emptyTopView
|
||||
}
|
||||
|
||||
var isHeaderVisible: Bool { true }
|
||||
@@ -77,6 +83,12 @@ class EQNBaseContainerTableViewCell: UITableViewCell {
|
||||
headerLabel.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true
|
||||
headerLabel.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true
|
||||
headerLabel.heightAnchor.constraint(equalToConstant: 26.0).isActive = true
|
||||
} else {
|
||||
containerView.addSubview(emptyTopView)
|
||||
emptyTopView.topAnchor.constraint(equalTo: containerView.topAnchor).isActive = true
|
||||
emptyTopView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor).isActive = true
|
||||
emptyTopView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor).isActive = true
|
||||
emptyTopView.heightAnchor.constraint(equalToConstant: 0.0).isActive = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user