forked from DO-NOTTO-DO/NotToDo-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge] 'develop' into feature/DO-NOTTO-DO#84
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
NotToDo/NotToDo/Presentation/Common/Calendar/CalendarDayCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// CalendarDayCell.swift | ||
// NotToDo | ||
// | ||
// Created by 강윤서 on 2023/01/13. | ||
// | ||
|
||
import UIKit | ||
|
||
import FSCalendar | ||
|
||
enum BackgroundType: Int { | ||
case today | ||
case none | ||
} | ||
|
||
final class CalendarDayCell: FSCalendarCell { | ||
|
||
// MARK: - Properties | ||
|
||
weak var dayBackView: UIView! | ||
var backgroundType: BackgroundType = .today { | ||
didSet { | ||
setUI() | ||
} | ||
} | ||
|
||
// MARK: - Life Cycle | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setUI() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init!(coder aDecoder: NSCoder!) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
} | ||
} | ||
|
||
extension CalendarDayCell { | ||
private func setUI() { | ||
switch self.backgroundType { | ||
case .today: | ||
dayBackView.backgroundColor = .yellow_mild | ||
case .none: | ||
dayBackView.backgroundColor = .nottodoGray1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters