Hi everyone, ran into this problem: there is a table view; it has a header view. header view has 2 buttons one button (expandButton) is clickable and the other (closeButton) is not please help me figure it out
private(set) lazy var expandButton: UIButton = {
let button = UIButton()
button.setTitleStyled(buttonLabelText, fontName: Constants.robotoMediumFont, fontSize: appearance.expandButtonLabelSize, fontColor: appearance.textColor)
button.addTarget(self, action: #selector(expandLabel), for: .touchUpInside)
return button
}()
private(set) lazy var closeButton: UIButton = {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.setImage(UIImage(named: "24_x_24_close"), for: .normal)
button.addTarget(self, action: #selector(closeButtonTapped), for: UIControl.Event.touchUpInside)
return button
}()
@objc func expandLabel() {
print("Done")
let params: [AnyHashable : Any] = ["installationId": Constants.deviceUniqueId as Any, "product": product?.code as Any]
appMetricaFactory = factory.makeAppMetricaFactory()
appMetricaFactory?.sendRequest(name: "productShowMoreDescription", parametrs: params)
if CardConst.expandedState == .collapsed {
CardConst.expandedState = .expanded
} else {
CardConst.expandedState = .collapsed
}
ProductCardViewController.shared?.updateView()
}
@objc func closeButtonTapped(_ sender: UIButton) {
print("Tapped")
ProductCardViewController.shared?.customizeView()
onClose?()
}