Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
79f6f28
setting: #360 공통퀘스트 UI에 필요한 이미지 세팅
dev-domo Feb 18, 2026
47cb1d7
feat: 날짜별 공통퀘스트 조회 API 연동을 위한 준비
dev-domo Feb 22, 2026
2c91dbb
refactor: #360 CommonQuestViewController 생성 시 뷰모델 주입
dev-domo Feb 22, 2026
aec0bb7
feat: #360 dequeueReusableCell 메서드 확장 구현
dev-domo Feb 22, 2026
5d157bf
feat: #360 identifier 확장 구현
dev-domo Feb 22, 2026
b000618
style: #360 공통퀘스트 뷰 및 뷰컨트롤러 구현
dev-domo Feb 22, 2026
bcaf3a5
style: #360 테이블 뷰의 헤더 뷰 구현
dev-domo Feb 22, 2026
8666e68
style: #360 테이블 뷰의 섹션 헤더(날짜 선택) 구현
dev-domo Feb 22, 2026
5de55a1
style: #360 퀘스트 내용 셀 구현
dev-domo Feb 22, 2026
b6083bc
style: #360 공통퀘스트 답변이 존재하는 경우의 테이블 뷰 셀 구현
dev-domo Feb 22, 2026
4d5fc28
style: #360 공통퀘스트 답변이 없는 경우의 테이블 뷰 셀 구현
dev-domo Feb 22, 2026
7e9654a
refactor: #360 dateFormatter를 뷰컨트롤러로 이동
dev-domo Feb 22, 2026
1695f5a
refactor: #360 fatalError가 발생하지 않도록 방지
dev-domo Feb 22, 2026
29a1420
refactor: #360 버튼 타이틀 색상 설정 코드 수정
dev-domo Feb 23, 2026
507b27f
refactor: #360 applyByeBooFont 메서드 적용
dev-domo Feb 23, 2026
45d9bf7
refactor: #360 white5 색상 적용
dev-domo Feb 23, 2026
04cc8a0
refactor: #360 ByeBooTipTag 안에 들어갈 텍스트를 주입
dev-domo Feb 23, 2026
075cbc8
refactor: #360 ByeBooTipTag 최소 너비 설정
dev-domo Feb 23, 2026
a875874
refactor: #360 수정된 ByeBooTipTag 적용
dev-domo Feb 23, 2026
0e635f8
refactor: #360 historyButton에 ByeBooTipTag 컴포넌트 적용
dev-domo Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ByeBoo-iOS/ByeBoo-iOS/Data/Repository/QuestsRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation

struct DefaultQuestRepository: QuestsInterface {

private let network: NetworkService
private let userDefaultsService: UserDefaultService

Expand Down Expand Up @@ -118,6 +119,10 @@ struct DefaultQuestRepository: QuestsInterface {
try await editQuest(questID: questID, answer: answer, imageKey: imageKey)
}

func fetchCommoncQuest(date: String) async throws -> CommonQuestAnswersEntity {
.stub()
}

// MARK: private function

private func makeSignedURL(imageKey: String) async throws -> String {
Expand Down Expand Up @@ -223,4 +228,8 @@ final class MockQuestsRepository: QuestsInterface {
func editActiveQuest(questID: Int, answer: String, image: Data?, imageKey: String, isImageChanged: Bool) async throws {
self.editActiveQuestCalled = true
}

func fetchCommoncQuest(date: String) async throws -> CommonQuestAnswersEntity {
.stub()
}
}
4 changes: 4 additions & 0 deletions ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ struct DomainDependencyAssembler: DependencyAssembler {
DIContainer.shared.register(type: FetchCompletedQuestsUseCase.self) { _ in
return DefaultFetchCompletedQuestsUseCase(repository: questRepository)
}

DIContainer.shared.register(type: FetchCommonQuestByDateUseCase.self) { _ in
return DefaultFetchCommonQuestByDateUseCase(repository: questRepository)
}

DIContainer.shared.register(type: AutoLoginUseCase.self) { _ in
return DefaultAutoLoginUseCase(repository: authRepository)
Expand Down
46 changes: 46 additions & 0 deletions ByeBoo-iOS/ByeBoo-iOS/Domain/Entity/CommonQuestAnswersEntity.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// CommonQuestAnswersEntity.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/17/26.
//

import Foundation

struct CommonQuestAnswersEntity {
let question: String
let answerCount: Int
let isAnswered: Bool
let answers: [CommonQuestAnswerEntity]
}

struct CommonQuestAnswerEntity {
let answerID: Int
let writer: String
let profileIcon: String
let writtenAt: Date
let content: String
}
Comment on lines +10 to +23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뭐가 다른건지 한참 봣네요 ㅋㅋㅋㅋ


extension CommonQuestAnswersEntity {
static func stub() -> Self {
.init(
question: "연애에서 반복된 문제 패턴 3가지를 생각해보아요",
answerCount: 0,
isAnswered: false,
answers: []
)
}
}

extension CommonQuestAnswerEntity {
static func stub() -> Self {
.init(
answerID: 1,
writer: "장원영",
profileIcon: "SO_SO",
writtenAt: Date.now,
content: "헤어진 지 벌써 일주일이 지났습니다. 처음에는 실감이 안 나서 눈물조차 나오지 않았어요. 그저 멍하니 천장만 바라보며 시간을 보냈습니다. 그런데 오늘 아침, 습관적으로 휴대폰을 확인하다가 더 이상 '굿모닝' 인사를 보낼 사람이 없다는 사실을 깨닫고 그제야 무너져 내렸습니다. 밥알이 모래알 같아서 잘 넘어가지도 않네요. 친구들은 시간이 약이라고, 더 좋은 사람 만날 거라고 위로하지만 지금 당장은 그 어떤 말도 귀에 들어오지 않습니다."
Comment on lines +40 to +43
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

원영씨 이별해서어뜩해..

)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ protocol QuestsInterface {
image: Data?,
imageKey: String,
isImageChanged: Bool) async throws
func fetchCommoncQuest(date: String) async throws -> CommonQuestAnswersEntity
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// FetchCommonQuestByDateUseCase.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/17/26.
//

protocol FetchCommonQuestByDateUseCase {
func execute(date: String) async throws -> CommonQuestAnswersEntity
}

struct DefaultFetchCommonQuestByDateUseCase: FetchCommonQuestByDateUseCase {

private let repository: QuestsInterface

init(repository: QuestsInterface) {
self.repository = repository
}

func execute(date: String) async throws -> CommonQuestAnswersEntity {
try await repository.fetchCommoncQuest(date: date)
}
}

struct MockFetchCommonQuestByDateUseCase: FetchCommonQuestByDateUseCase {

func execute(date: String) async throws -> CommonQuestAnswersEntity {
.stub()
}
}
22 changes: 22 additions & 0 deletions ByeBoo-iOS/ByeBoo-iOS/Presentation/Extension/UITableView+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// UITableView+.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/22/26.
//

import UIKit

extension UITableView {

func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T {
guard let cell = self.dequeueReusableCell(
withIdentifier: T.identifier,
for: indexPath
) as? T else {
return T()
}

return cell
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// UITableViewCell+.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/17/26.
//

import UIKit

extension UITableViewCell {
static var identifier: String {
String(describing: self)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// UITableViewHeaderFooterView+.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/22/26.
//

import UIKit

extension UITableViewHeaderFooterView {
static var identifier: String {
String(describing: self)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
//
// CommonQuestAnswersCell.swift
// ByeBoo-iOS
//
// Created by APPLE on 2/17/26.
//

import UIKit

final class CommonQuestAnswersCell: UITableViewCell {

private let containerView = UIView()
private let userIconView = UIImageView()
private let userNicknameLabel = UILabel()
private let answerContentLabel = UILabel()
private let writtenDateLabel = UILabel()

override init(
style: UITableViewCell.CellStyle,
reuseIdentifier: String?
) {
super.init(style: style, reuseIdentifier: reuseIdentifier)

setStyle()
setUI()
setLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func setStyle() {
self.do {
$0.backgroundColor = .clear
$0.selectionStyle = .none
}
containerView.do {
$0.layer.cornerRadius = 12
$0.backgroundColor = UIColor.white.withAlphaComponent(0.05)
}
userNicknameLabel.do {
$0.textColor = .grayscale200
$0.font = FontManager.body6R14.font
}
answerContentLabel.do {
$0.textColor = .grayscale100
$0.font = FontManager.body3R16.font
$0.numberOfLines = 0
}
writtenDateLabel.do {
$0.textColor = .grayscale400
$0.font = FontManager.body6R14.font
}
}

private func setUI() {
addSubview(containerView)
containerView.addSubviews(
userIconView,
userNicknameLabel,
answerContentLabel,
writtenDateLabel
)
}

private func setLayout() {
containerView.snp.makeConstraints {
$0.top.equalToSuperview().inset(24.adjustedH)
$0.horizontalEdges.equalToSuperview().inset(24.adjustedW)
$0.bottom.equalToSuperview()
}
userIconView.snp.makeConstraints {
$0.top.equalToSuperview().inset(16.adjustedH)
$0.leading.equalToSuperview().inset(24.adjustedW)
$0.size.equalTo(20.adjustedW)
}
userNicknameLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(16.adjustedH)
$0.leading.equalTo(userIconView.snp.trailing).offset(4.adjustedW)
$0.centerY.equalTo(userIconView.snp.centerY)
}
answerContentLabel.snp.makeConstraints {
$0.top.equalTo(userIconView.snp.bottom).offset(12.adjustedH)
$0.horizontalEdges.equalToSuperview().inset(24.adjustedW)
$0.height.equalTo(47.adjustedH)
}
writtenDateLabel.snp.makeConstraints {
$0.top.equalTo(answerContentLabel.snp.bottom).offset(20.adjustedH)
$0.leading.equalToSuperview().inset(24.adjustedW)
$0.bottom.equalToSuperview().inset(16.adjustedH)
}
}
}

extension CommonQuestAnswersCell {

func bind(
profileIcon: UIImage?,
answer: CommonQuestAnswerEntity,
writtenAt: String
) {
if let profileIcon {
userIconView.image = profileIcon
} else {
userIconView.do {
$0.backgroundColor = .grayscale600
$0.layer.cornerRadius = 10
}
}
Comment on lines +103 to +110
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

근데 프로필아이콘은 모든 사람들이 다 가지고 있지 않나여? 기본 배경값 설정을 해주신 이유가 궁금합니다!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

호옥시나 서버에서 프로필 이미지 타이틀을 잘못 넘겨줬을 때를 디버깅하기 위한 코드입니당

userNicknameLabel.text = answer.writer
answerContentLabel.text = answer.content
writtenDateLabel.text = writtenAt
}
}
Loading
Loading