In the AppFullScrenHeaderCell, you must put contentView.addSubview() Here is the code blow to the problem. That should solve the issue.
class AppFullScreenHeaderCell: UITableViewCell {
let todayCell = TodayCell()
let closeButton: UIButton = {
let button = UIButton(type: .system)
button.setImage(#imageLiteral(resourceName: "apps"), for: .normal)
return button
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(todayCell)
todayCell.fillSuperview()
contentView.addSubview(closeButton)
closeButton.anchor(top: topAnchor, leading: nil, bottom: nil, trailing: trailingAnchor, padding: .init(top: 12, left: 0, bottom: 0, right: 12), size: .init(width: 80, height: 38))
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}