// // DashboardAssessmentListTableViewCell.swift // LMS // // Created by Suraj Kumar Mandal on 06/01/23. // import UIKit class DashboardAssessmentListTableViewCell: UITableViewCell { @IBOutlet var assessmentCustomView: UIView! @IBOutlet var assessmentNameLabel: UILabel! @IBOutlet var dropdownButton: UIButton! @IBOutlet var hiddenCustomView: UIView! @IBOutlet var dayDateLabel: UILabel! @IBOutlet var timeLabel: UILabel! @IBOutlet var startButton: UIButton! @IBOutlet var activeStatusLabel: UILabel! @IBOutlet var statusIndicatorImageView: UIImageView! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state if isDetailViewHidden, selected { showDetailView() } else { hideDetailView() } } func commonInit() { selectionStyle = .none hiddenCustomView.isHidden = true dropdownButton.setImage(UIImage(systemName: "chevron.right"), for: .normal) } } extension DashboardAssessmentListTableViewCell { var isDetailViewHidden: Bool { return hiddenCustomView.isHidden } func showDetailView() { hiddenCustomView.isHidden = false dropdownButton.setImage(UIImage(systemName: "chevron.down"), for: .normal) } func hideDetailView() { hiddenCustomView.isHidden = true dropdownButton.setImage(UIImage(systemName: "chevron.right"), for: .normal) } }