Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.39 KB | None | 0 0
  1. var isToday : Bool = false {
  2.         didSet {
  3.             switch isToday {
  4.             case true:
  5.                 self.bgView.backgroundColor = CalendarView.Style.cellColorToday
  6.                 self.textLabel.textColor    = CalendarView.Style.cellTextColorToday
  7.             case false:
  8.                 self.bgView.backgroundColor = CalendarView.Style.cellColorDefault
  9.                 self.textLabel.textColor = CalendarView.Style.cellTextColorDefault
  10.             }
  11.         }
  12.     }
  13.    
  14.     var isWeekend: Bool = false {
  15.         didSet {
  16.             if self.isToday { return }
  17.             switch isWeekend {
  18.             case true:
  19.                 self.textLabel.textColor = CalendarView.Style.cellTextColorWeekend
  20.             case false:
  21.                 self.textLabel.textColor = CalendarView.Style.cellTextColorDefault
  22.             }
  23.         }
  24.     }
  25.    
  26.     override open var isSelected : Bool {
  27.         didSet {
  28.             switch isSelected {
  29.             case true:
  30.                 self.bgView.layer.borderColor = CalendarView.Style.cellSelectedBorderColor.cgColor
  31.                 self.bgView.layer.borderWidth = CalendarView.Style.cellSelectedBorderWidth
  32.             case false:
  33.                 self.bgView.layer.borderColor = CalendarView.Style.cellBorderColor.cgColor
  34.                 self.bgView.layer.borderWidth = CalendarView.Style.cellBorderWidth
  35.             }
  36.         }
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement