DashboardAssessmentListTableViewCell.swift 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // DashboardAssessmentListTableViewCell.swift
  3. // LMS
  4. //
  5. // Created by Suraj Kumar Mandal on 06/01/23.
  6. //
  7. import UIKit
  8. class DashboardAssessmentListTableViewCell: UITableViewCell {
  9. @IBOutlet var assessmentCustomView: UIView!
  10. @IBOutlet var assessmentNameLabel: UILabel!
  11. @IBOutlet var dropdownButton: UIButton!
  12. @IBOutlet var hiddenCustomView: UIView!
  13. @IBOutlet var dayDateLabel: UILabel!
  14. @IBOutlet var timeLabel: UILabel!
  15. @IBOutlet var startButton: UIButton!
  16. @IBOutlet var activeStatusLabel: UILabel!
  17. @IBOutlet var statusIndicatorImageView: UIImageView!
  18. override func awakeFromNib() {
  19. super.awakeFromNib()
  20. // Initialization code
  21. }
  22. override func setSelected(_ selected: Bool, animated: Bool) {
  23. super.setSelected(selected, animated: animated)
  24. // Configure the view for the selected state
  25. if isDetailViewHidden, selected {
  26. showDetailView()
  27. } else {
  28. hideDetailView()
  29. }
  30. }
  31. func commonInit() {
  32. selectionStyle = .none
  33. hiddenCustomView.isHidden = true
  34. dropdownButton.setImage(UIImage(systemName: "chevron.right"), for: .normal)
  35. }
  36. }
  37. extension DashboardAssessmentListTableViewCell {
  38. var isDetailViewHidden: Bool {
  39. return hiddenCustomView.isHidden
  40. }
  41. func showDetailView() {
  42. hiddenCustomView.isHidden = false
  43. dropdownButton.setImage(UIImage(systemName: "chevron.down"), for: .normal)
  44. }
  45. func hideDetailView() {
  46. hiddenCustomView.isHidden = true
  47. dropdownButton.setImage(UIImage(systemName: "chevron.right"), for: .normal)
  48. }
  49. }