-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat/NST-13] 그룹상세화면 구현 #33
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Supervisor account.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icon_share.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vector는 너무 포괄적인 이름 같아요! ic_arrow_right 같은 네이밍도 괜찮지 않을까요? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Vector.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ public extension NSTDateUtility { | |
} | ||
|
||
extension NSTDateUtility { | ||
///타임테이블 뷰 : "요일 월/일" | ||
static func dateList(_ dateStrings: [String]) -> [String] { | ||
Comment on lines
+97
to
98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NSTDateUtility는 모든 개발자들이 사용하는 유틸리티일거에요.
둘 중 하나로 골라서 진행해보시면 좋을 것 같아요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오우 이거 수정한다는걸 깜먹고 올렸네요 수정하고 올리겠슴당 |
||
let formatter = NSTDateUtility(format: .yyyyMMddTHHmmss) // ISO 8601 형식 | ||
let displayFormatter = NSTDateUtility(format: .MMddEE) // 출력 형식 | ||
|
@@ -102,7 +103,8 @@ extension NSTDateUtility { | |
} | ||
} | ||
} | ||
|
||
|
||
///타임테이블 뷰 : "00시" | ||
static func timeList(_ startTime: String, _ endTime: String) -> [String] { | ||
let formatter = NSTDateUtility(format: .yyyyMMddTHHmmss) // ISO 8601 형식 | ||
var result: [String] = [] | ||
|
@@ -126,4 +128,34 @@ extension NSTDateUtility { | |
} | ||
return result | ||
} | ||
|
||
///약속상세뷰 : "9월 7일 (일) 10:00~12:00" | ||
static func durationList(_ startTime: String, _ endTime: String) -> String { | ||
let formatter = NSTDateUtility(format: .yyyyMMddTHHmmss) // ISO 8601 형식 | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.locale = Locale(identifier: "ko_KR") | ||
dateFormatter.timeZone = TimeZone(identifier: "Asia/Seoul") | ||
|
||
// 날짜 포맷: "9월 7일 (일)" | ||
dateFormatter.dateFormat = "M월 d일 (E)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NSTDateUtility에 이 포맷 case로 추가 하면 돼요! |
||
|
||
// 시간 포맷: "10:00" | ||
let timeFormatter = DateFormatter() | ||
timeFormatter.locale = Locale(identifier: "ko_KR") | ||
timeFormatter.timeZone = TimeZone(identifier: "Asia/Seoul") | ||
timeFormatter.dateFormat = "HH:mm" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 코드를 막기 위해 본 NSTDateUtility 코드가 존재한답니다! |
||
|
||
switch (formatter.date(from: startTime), formatter.date(from: endTime)) { | ||
case (.success(let start), .success(let end)): | ||
let dateString = dateFormatter.string(from: start) // "9월 7일 (일)" | ||
let startTimeString = timeFormatter.string(from: start) // "10:00" | ||
let endTimeString = timeFormatter.string(from: end) // "12:00" | ||
|
||
return "\(dateString) \(startTimeString)~\(endTimeString)" | ||
|
||
default: | ||
print("Failed to parse start or end time.") | ||
return "" | ||
} | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CollectionViewCell은 작성하실 때 prepareForReuse가 필요한 부분은 없는지 한 번씩 확인해보세요! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// | ||
// ConfirmedCVC.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 오연서 on 2/1/25. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
import Then | ||
import ReactorKit | ||
|
||
final class ConfirmedCVC: UICollectionViewCell, View { | ||
|
||
// MARK: Properties | ||
static let identifier = "ConfirmedCVC" | ||
var disposeBag = DisposeBag() | ||
|
||
// MARK: Views | ||
private let chip = UIView() | ||
private let scheduleTitleLabel = UILabel() | ||
private let timeLabel = UILabel() | ||
private let divider = UIView() | ||
|
||
// MARK: Init | ||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
setUpHierarchy() | ||
setUpUI() | ||
setUpLayout() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: setUpHierarchy | ||
private func setUpHierarchy() { | ||
[chip, scheduleTitleLabel, timeLabel, divider].forEach { | ||
self.addSubview($0) | ||
} | ||
} | ||
|
||
// MARK: setUpUI | ||
private func setUpUI() { | ||
chip.do { | ||
$0.layer.cornerRadius = 6.5 | ||
} | ||
|
||
scheduleTitleLabel.do { | ||
$0.font = .PretendardStyle.b1_sb.font | ||
$0.textColor = .appGray900 | ||
} | ||
|
||
timeLabel.do { | ||
$0.font = .PretendardStyle.c3_r.font | ||
$0.textColor = .appGray700 | ||
} | ||
|
||
divider.do { | ||
$0.backgroundColor = .appGray200 | ||
} | ||
} | ||
|
||
// MARK: setUpLayout | ||
private func setUpLayout() { | ||
chip.snp.makeConstraints { | ||
$0.top.equalToSuperview().offset(15) | ||
$0.leading.equalToSuperview().offset(6) | ||
$0.size.equalTo(13) | ||
} | ||
|
||
scheduleTitleLabel.snp.makeConstraints { | ||
$0.top.equalToSuperview().offset(10) | ||
$0.leading.equalTo(chip.snp.trailing).offset(9) | ||
} | ||
|
||
timeLabel.snp.makeConstraints { | ||
$0.top.equalTo(scheduleTitleLabel.snp.bottom).offset(4) | ||
$0.leading.equalTo(scheduleTitleLabel) | ||
} | ||
|
||
divider.snp.makeConstraints { | ||
$0.bottom.equalToSuperview() | ||
$0.horizontalEdges.equalToSuperview() | ||
$0.height.equalTo(1) | ||
} | ||
} | ||
} | ||
|
||
extension ConfirmedCVC { | ||
func bind(reactor: ConfirmedCellReactor) { | ||
let schedule = reactor.currentState.schedule | ||
chip.backgroundColor = schedule.schedule.category.displayColor | ||
scheduleTitleLabel.text = schedule.schedule.name | ||
timeLabel.text = NSTDateUtility.durationList(schedule.startTime, schedule.endTime) | ||
} | ||
Comment on lines
+92
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rx 바인드하는 내용은 없으니 이름을 바꿔도 괜찮지 않을까요?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 뷰컨트롤러에서 self.reactor=reactor 로 할당하기 위해 bind 메소드를 썼습미다 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// ConfirmedCellReactor.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 오연서 on 2/3/25. | ||
// | ||
|
||
import ReactorKit | ||
import RxSwift | ||
|
||
final class ConfirmedCellReactor: Reactor { | ||
typealias Action = NoAction | ||
struct State { | ||
let schedule: ExtendedSchedule | ||
} | ||
|
||
let initialState: State | ||
|
||
init(schedule: ExtendedSchedule) { | ||
self.initialState = State(schedule: schedule) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 폰트 시스템은 언제 한번 날잡아서 기강 잡아야겠네요..