@@ -16,19 +16,21 @@ final class DateView: UIView {
1616 static let dateButtonTopSpacing : CGFloat = 7
1717 static let dateButtonSize : CGFloat = 30
1818 static let dateLabelHeight : CGFloat = 17
19+ static let allCompletedIconTopSpacing : CGFloat = 5
1920 }
2021
2122 private let dayLabel = UILabel ( )
2223 private let dateButton = UIButton ( )
2324 private let dateLabel = UILabel ( )
25+ private let allCompletedIcon = UIImageView ( )
2426 private let date : Date
2527 private let isToday : Bool
2628 private var isSelected : Bool {
2729 didSet {
2830 updateAttribute ( )
2931 }
3032 }
31- var didTappedDateButton : ( ( Date ) -> Void ) ?
33+ var didTapDateButton : ( ( Date ) -> Void ) ?
3234
3335 init (
3436 date: Date ,
@@ -66,12 +68,16 @@ final class DateView: UIView {
6668 dateLabel. text = " \( date. convertToString ( dateType: . date) ) "
6769 dateLabel. font = BitnagilFont ( style: . body2, weight: . medium) . font
6870 dateLabel. textColor = BitnagilColor . gray70
71+
72+ allCompletedIcon. image = BitnagilIcon . asteriskIcon
73+ allCompletedIcon. isHidden = true
6974 }
7075
7176 private func configureLayout( ) {
7277 addSubview ( dayLabel)
7378 addSubview ( dateButton)
7479 dateButton. addSubview ( dateLabel)
80+ addSubview ( allCompletedIcon)
7581
7682 dayLabel. snp. makeConstraints { make in
7783 make. top. leading. trailing. equalToSuperview ( )
@@ -89,6 +95,11 @@ final class DateView: UIView {
8995 make. center. equalToSuperview ( )
9096 make. height. equalTo ( Layout . dateLabelHeight)
9197 }
98+
99+ allCompletedIcon. snp. makeConstraints { make in
100+ make. top. equalTo ( dateButton. snp. bottom) . offset ( Layout . allCompletedIconTopSpacing)
101+ make. centerX. equalToSuperview ( )
102+ }
92103 }
93104
94105 private func updateAttribute( ) {
@@ -106,10 +117,14 @@ final class DateView: UIView {
106117 }
107118
108119 private func selectDate( ) {
109- didTappedDateButton ? ( date)
120+ didTapDateButton ? ( date)
110121 }
111122
112123 func updateSelectState( isSelected: Bool ) {
113124 self . isSelected = isSelected
114125 }
126+
127+ func updateAllCompleted( ) {
128+ allCompletedIcon. isHidden. toggle ( )
129+ }
115130}
0 commit comments