diff --git a/fit-a-pet-client/fit-a-pet-client.xcworkspace/xcuserdata/maclove.xcuserdatad/UserInterfaceState.xcuserstate b/fit-a-pet-client/fit-a-pet-client.xcworkspace/xcuserdata/maclove.xcuserdatad/UserInterfaceState.xcuserstate index 909c17b9..76f8c439 100644 Binary files a/fit-a-pet-client/fit-a-pet-client.xcworkspace/xcuserdata/maclove.xcuserdatad/UserInterfaceState.xcuserstate and b/fit-a-pet-client/fit-a-pet-client.xcworkspace/xcuserdata/maclove.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/CalendarView.swift b/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/CalendarView.swift index 1aeb0ef0..6157db27 100644 --- a/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/CalendarView.swift +++ b/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/CalendarView.swift @@ -2,7 +2,7 @@ import UIKit import SnapKit import FSCalendar -class CalendarView: UIView { +class CalendarView: UIView, FSCalendarDelegateAppearance { let calendar = FSCalendar() override init(frame: CGRect) { @@ -30,12 +30,16 @@ class CalendarView: UIView { calendar.locale = Locale(identifier: "ko_KR") calendar.appearance.titleTodayColor = UIColor(named: "PrimaryColor") - calendar.appearance.todayColor = .clear + calendar.appearance.todayColor = UIColor(named: "Secondary") + + + calendar.appearance.borderRadius = 0.5 calendar.appearance.todaySelectionColor = UIColor(named: "PrimaryColor") calendar.snp.makeConstraints { make in make.edges.equalToSuperview() } } + } diff --git a/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/PanModalDateView.swift b/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/PanModalDateView.swift index bd1f51f9..12e49416 100644 --- a/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/PanModalDateView.swift +++ b/fit-a-pet-client/fit-a-pet-client/View/CalendarVCView/PanModalDateView.swift @@ -7,8 +7,8 @@ class PanModalDateView: UIView { let labelStackView = UIStackView() let datePickerBtn = UIButton() let timePickerBtn = UIButton() - private var isDatePickerSelected = false - private var isTimePickerSelected = false + var isDatePickerSelected = false + var isTimePickerSelected = false private var selectedButton: UIButton? weak var delegate: PanModalDateViewDelegate? @@ -96,19 +96,24 @@ class PanModalDateView: UIView { } @objc private func datePickerTapped() { - isDatePickerSelected.toggle() - deselectOtherButton() - selectedButton = datePickerBtn - datePickerBtn.setTitleColor(isDatePickerSelected ? UIColor(named: "PrimaryColor") : .black, for: .normal) - delegate?.datePickerButtonTapped() + if !isTimePickerSelected{ + isDatePickerSelected.toggle() + deselectOtherButton() + selectedButton = datePickerBtn + datePickerBtn.setTitleColor(isDatePickerSelected ? UIColor(named: "PrimaryColor") : .black, for: .normal) + delegate?.datePickerButtonTapped() + } } @objc private func timePickerTapped() { - isTimePickerSelected.toggle() - deselectOtherButton() - selectedButton = timePickerBtn - timePickerBtn.setTitleColor(isDatePickerSelected ? UIColor(named: "PrimaryColor") : .black, for: .normal) - delegate?.timePickerButtonTapped() + if !isDatePickerSelected{ + isTimePickerSelected.toggle() + deselectOtherButton() + selectedButton = timePickerBtn + timePickerBtn.setTitleColor(isTimePickerSelected ? UIColor(named: "PrimaryColor") : .black, for: .normal) + delegate?.timePickerButtonTapped() + } + } private func deselectOtherButton() { diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/CalendarPanModalVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/CalendarPanModalVC.swift index 96938d80..198c684d 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/CalendarPanModalVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/CalendarPanModalVC.swift @@ -10,6 +10,7 @@ class CalendarPanModalVC: UIViewController, PanModalDateViewDelegate { let locationView = CustomVerticalView(labelText: "장소", placeholder: "장소") let otherSettingView = OtherSettingsView() + let registrationBtn = CustomNextBtn(title: "등록하기") let dateView = PanModalDateView() let dateTimePicker = UIDatePicker() @@ -21,15 +22,18 @@ class CalendarPanModalVC: UIViewController, PanModalDateViewDelegate { private func setupViews() { view.addSubview(scrollView) + view.addSubview(registrationBtn) scrollView.snp.makeConstraints { make in - make.edges.equalToSuperview() + make.top.leading.trailing.equalToSuperview() + make.bottom.equalTo(registrationBtn.snp.top).offset(15) } dateView.delegate = self + scheduleView.textInputField.delegate = self + locationView.textInputField.delegate = self dateTimePicker.isHidden = true - dateTimePicker.datePickerMode = .date dateTimePicker.preferredDatePickerStyle = .inline @@ -84,6 +88,12 @@ class CalendarPanModalVC: UIViewController, PanModalDateViewDelegate { make.height.equalTo(400) make.bottom.equalTo(scrollView.snp.bottom) } + + registrationBtn.snp.makeConstraints{make in + make.leading.equalTo(view.snp.leading).offset(16) + make.trailing.equalTo(view.snp.trailing).offset(-16) + make.bottom.equalTo(view.snp.bottom).offset(-50) + } } private func setupActions() { @@ -104,47 +114,50 @@ class CalendarPanModalVC: UIViewController, PanModalDateViewDelegate { func datePickerButtonTapped() { dateTimePicker.datePickerMode = .date dateTimePicker.preferredDatePickerStyle = .inline - if dateTimePicker.isHidden { - - dateTimePicker.isHidden = false - - dateTimePicker.snp.updateConstraints { make in - make.height.equalTo(300) + if !dateView.isTimePickerSelected{ + if dateTimePicker.isHidden { + dateTimePicker.isHidden = false + + dateTimePicker.snp.updateConstraints { make in + make.height.equalTo(300) + } + + } else { + dateTimePicker.isHidden = true + + dateTimePicker.snp.updateConstraints { make in + make.height.equalTo(0) + } } - - } else { - dateTimePicker.isHidden = true - - dateTimePicker.snp.updateConstraints { make in - make.height.equalTo(0) + UIView.animate(withDuration: 0.3) { + self.view.layoutIfNeeded() } } - UIView.animate(withDuration: 0.3) { - self.view.layoutIfNeeded() - } + } func timePickerButtonTapped() { dateTimePicker.datePickerMode = .time dateTimePicker.preferredDatePickerStyle = .wheels - if dateTimePicker.isHidden { - - dateTimePicker.isHidden = false - - dateTimePicker.snp.updateConstraints { make in - make.height.equalTo(250) + if !dateView.isDatePickerSelected{ + if dateTimePicker.isHidden { + dateTimePicker.isHidden = false + + dateTimePicker.snp.updateConstraints { make in + make.height.equalTo(250) + } + + } else { + dateTimePicker.isHidden = true + + dateTimePicker.snp.updateConstraints { make in + make.height.equalTo(0) + } } - - } else { - dateTimePicker.isHidden = true - - dateTimePicker.snp.updateConstraints { make in - make.height.equalTo(0) + UIView.animate(withDuration: 0.3) { + self.view.layoutIfNeeded() } } - UIView.animate(withDuration: 0.3) { - self.view.layoutIfNeeded() - } } } @@ -166,3 +179,26 @@ extension CalendarPanModalVC: PanModalPresentable { } } +extension CalendarPanModalVC: UITextFieldDelegate{ + + func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + + let scheduleText = (scheduleView.textInputField.text! as NSString).replacingCharacters(in: range, with: string) + let locationText = (locationView.textInputField.text! as NSString).replacingCharacters(in: range, with: string) + + if scheduleText.isEmpty{ + scheduleView.textInputField.layer.borderColor = UIColor(named: "Gray3")?.cgColor + }else{ + scheduleView.textInputField.layer.borderColor = UIColor(named: "PrimaryColor")?.cgColor + } + + if locationText.isEmpty{ + locationView.textInputField.layer.borderColor = UIColor(named: "Gray3")?.cgColor + }else{ + locationView.textInputField.layer.borderColor = UIColor(named: "PrimaryColor")?.cgColor + } + + + return true + } +} diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputAuthNumVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputAuthNumVC.swift index 22db0e8d..29678e14 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputAuthNumVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputAuthNumVC.swift @@ -71,7 +71,7 @@ class FindInputAuthNumVC: CustomNavigationBar{ } nextIdCheckBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputPhoneNumVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputPhoneNumVC.swift index 66391d65..d8cc6cd0 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputPhoneNumVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/FindInputPhoneNumVC.swift @@ -61,7 +61,7 @@ class FindInputPhoneNumVC: CustomNavigationBar{ } nextInputAuthNumBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/ResetPwVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/ResetPwVC.swift index 191cb048..5c37b244 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/ResetPwVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/FindAccountVC/ResetPwVC.swift @@ -70,7 +70,7 @@ class ResetPwVC: CustomNavigationBar{ } resetPwCompleteBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/LoginVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/LoginVC.swift index f73acddd..bbdaf36d 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/LoginVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/LoginVC.swift @@ -67,8 +67,6 @@ class LoginVC: UIViewController{ containerView.addSubview(loginBtn) view.addSubview(containerView) - containerView.layer.borderWidth = 1 - containerView.snp.makeConstraints { make in make.centerY.equalToSuperview() make.height.equalTo(350) @@ -206,14 +204,14 @@ class LoginVC: UIViewController{ FindIdPwSwitch.findAuth = "아이디 찾기" FindIdPwSwitch.findtype = "uid" let findIdVC = FindInputPhoneNumVC(title: FindIdPwSwitch.findAuth) - self.navigationController?.pushViewController(findIdVC, animated: false) + self.navigationController?.pushViewController(findIdVC, animated: true) } @objc func changeFindPwVC(_ sender: UIButton){ FindIdPwSwitch.findAuth = "비밀번호 찾기" FindIdPwSwitch.findtype = "password" let findPwVC = FindInputIdVC(title: FindIdPwSwitch.findAuth) - self.navigationController?.pushViewController(findPwVC, animated: false) + self.navigationController?.pushViewController(findPwVC, animated: true) } } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/CheckCareVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/CheckCareVC.swift index d375ea02..5d0d130b 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/CheckCareVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/CheckCareVC.swift @@ -60,7 +60,7 @@ class CheckCareVC : CustomNavigationBar { } nextUploadPetPhotoBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputGenderVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputGenderVC.swift index f111d13d..359bd43a 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputGenderVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputGenderVC.swift @@ -44,7 +44,7 @@ class InputGenderVC: CustomNavigationBar { } nextBirthBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetBirthVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetBirthVC.swift index efc0f9a8..8f36fd60 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetBirthVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetBirthVC.swift @@ -50,7 +50,7 @@ class InputPetBirthVC : CustomNavigationBar { } nextCheckCareBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetNameVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetNameVC.swift index 94580535..c42cf25b 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetNameVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputPetNameVC.swift @@ -55,7 +55,7 @@ class InputPetNameVC: CustomNavigationBar { } nextGenderBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputSpeciesVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputSpeciesVC.swift index 5bc7b965..3d1f2051 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputSpeciesVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/InputSpeciesVC.swift @@ -56,7 +56,7 @@ class InputSpeciesVC: CustomNavigationBar { } nextPetNameBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/UploadPetPhotoVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/UploadPetPhotoVC.swift index 1f402d3f..4511aab6 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/UploadPetPhotoVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/RegistPet/UploadPetPhotoVC.swift @@ -51,7 +51,7 @@ class UploadPetPhotoVC : CustomNavigationBar { } registCompleteBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputAuthNumVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputAuthNumVC.swift index f69b04bb..3ceb00bf 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputAuthNumVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputAuthNumVC.swift @@ -58,7 +58,7 @@ class InputAuthNumVC : UIViewController{ } nextIdBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputIdVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputIdVC.swift index a60bfd45..b8fb3b63 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputIdVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputIdVC.swift @@ -55,7 +55,7 @@ class InputIdVC : UIViewController { } nextPwBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputNickVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputNickVC.swift index 22f522dc..0532e9ff 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputNickVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputNickVC.swift @@ -52,7 +52,7 @@ class InputNickVC : UIViewController { } completeSignUpBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPhoneNumVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPhoneNumVC.swift index a44de9e6..d7cdc198 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPhoneNumVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPhoneNumVC.swift @@ -5,7 +5,7 @@ import Alamofire class InputPhoneNumVC : UIViewController { - private let nextAutnNumBtn = CustomNextBtn(title: "다음") + private let nextAuthNumBtn = CustomNextBtn(title: "다음") private let inputPhoneNum = UITextField() private let progressBar = CustomProgressBar.shared private let customLabel = ConstomLabel() @@ -17,13 +17,13 @@ class InputPhoneNumVC : UIViewController { initView() - nextAutnNumBtn.addTarget(self, action: #selector(changeInputAuthNumVC(_:)), for: .touchUpInside) + nextAuthNumBtn.addTarget(self, action: #selector(changeInputAuthNumVC(_:)), for: .touchUpInside) } private func initView(){ view.backgroundColor = .white - self.view.addSubview(nextAutnNumBtn) + self.view.addSubview(nextAuthNumBtn) self.view.addSubview(inputPhoneNum) self.view.addSubview(customLabel) @@ -55,8 +55,8 @@ class InputPhoneNumVC : UIViewController { make.right.equalTo(view.snp.right).offset(-16) } - nextAutnNumBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + nextAuthNumBtn.snp.makeConstraints{make in + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } @@ -140,7 +140,7 @@ class InputPhoneNumVC : UIViewController { extension InputPhoneNumVC: UITextFieldDelegate{ func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let updatedText = (inputPhoneNum.text! as NSString).replacingCharacters(in: range, with: string) - nextAutnNumBtn.updateButtonColor(updatedText, false) + nextAuthNumBtn.updateButtonColor(updatedText, false) if updatedText.isEmpty { inputPhoneNum.layer.borderColor = UIColor(named: "Gray3")?.cgColor diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPwVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPwVC.swift index fc0d442f..198a4213 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPwVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/SignUpVC/InputPwVC.swift @@ -77,7 +77,7 @@ class InputPwVC : UIViewController { } nextNickBtn.snp.makeConstraints{make in - make.bottom.equalTo(view.snp.bottom).offset(-65) + make.bottom.equalTo(view.snp.bottom).offset(-50) make.left.equalTo(view.snp.left).offset(16) make.right.equalTo(view.snp.right).offset(-16) } diff --git a/fit-a-pet-client/fit-a-pet-client/ViewControllers/TabBarVC/CalendarVC.swift b/fit-a-pet-client/fit-a-pet-client/ViewControllers/TabBarVC/CalendarVC.swift index bdce8647..810a8c8b 100644 --- a/fit-a-pet-client/fit-a-pet-client/ViewControllers/TabBarVC/CalendarVC.swift +++ b/fit-a-pet-client/fit-a-pet-client/ViewControllers/TabBarVC/CalendarVC.swift @@ -82,12 +82,26 @@ extension CalendarVC: CalendarStackViewDelegate{ } } -extension CalendarVC: FSCalendarDelegate{ +extension CalendarVC: FSCalendarDelegate, FSCalendarDelegateAppearance{ func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) { print("Selected Date: \(date)") } + func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, borderSelectionColorFor date: Date) -> UIColor? { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + + print("[INFO] dateFormatter.string(from: date) : " + dateFormatter.string(from: date)) + + switch dateFormatter.string(from: date) { + case dateFormatter.string(from: Date()): + return .blue + default: + return nil + } + } + func setCalendar() { calendarView.calendar.scope = .month calendarStackView.titleLabel.text = self.dateFormatter.string(from: calendarView.calendar.currentPage)