Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 16 additions & 9 deletions Wable-iOS/Domain/UseCase/Overview/OverviewUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct MockOverviewUseCaseImpl: OverviewUseCase {

private var randomDelaySecond: Double { .random(in: 0.3...1.0) }

private let lckTeams: [LCKTeam] = [.t1, .gen, .hle, .dk, .kt, .ns, .drx, .bro, .bfx, .dnf]
// 주의: 팀명 배열은 createMockGameSchedules() 내부에서만 정의해 사용합니다.

func fetchGameCategory() -> AnyPublisher<String, WableError> {
return .just("2025 LCK SPRING")
Expand Down Expand Up @@ -100,22 +100,29 @@ struct MockOverviewUseCaseImpl: OverviewUseCase {
}

private func createMockGameSchedules() -> AnyPublisher<[GameSchedule], WableError> {
Copy link
Member

Choose a reason for hiding this comment

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

mock을 붙이신 이유가 있나요 ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

저 메서드는 Mock 유즈케이스 객체의 내용입니다.

let teamNames: [String] = [
"T1", "GEN", "HLE", "DK", "KT", "NS", "DRX", "BRO", "BFX", "DNF",
"VKS", "AL", "BLG", "CFO", "FLY", "FNC", "G2", "IG", "MKOI", "PSG",
"TES", "TSW", "100T", "TBD"
]
Comment on lines +103 to +107
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

팀 개수가 홀수일 경우를 대비하세요.

teamNames 배열은 현재 24개(짝수)의 팀을 포함하고 있어 문제가 없지만, 향후 팀을 추가하거나 제거할 때 홀수 개가 되면 line 115-117의 페어링 로직에서 배열 인덱스 범위 초과 크래시가 발생할 수 있습니다.

다음 diff를 적용하여 안전장치를 추가하세요:

     private func createMockGameSchedules() -> AnyPublisher<[GameSchedule], WableError> {
         let teamNames: [String] = [
             "T1", "GEN", "HLE", "DK", "KT", "NS", "DRX", "BRO", "BFX", "DNF",
             "VKS", "AL", "BLG", "CFO", "FLY", "FNC", "G2", "IG", "MKOI", "PSG", 
             "TES", "TSW", "100T", "TBD"
         ]
+        
+        // 팀 개수가 홀수이면 마지막 팀 제외
+        let validTeamCount = teamNames.count - (teamNames.count % 2)
+        
         var mockGameSchedules: [GameSchedule] = []

그리고 line 114를 다음과 같이 수정하세요:

-            let rotatedTeams: [String] = (0..<teamNames.count).map { teamNames[($0 + dayOffset) % teamNames.count] }
+            let rotatedTeams: [String] = (0..<validTeamCount).map { teamNames[($0 + dayOffset) % teamNames.count] }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In Wable-iOS/Domain/UseCase/Overview/OverviewUseCase.swift around lines 103-107
(and referencing pairing logic at lines 114-117), the hard-coded teamNames list
can become odd-count in future causing an index-out-of-range crash during
pairing; fix by ensuring teamNames has an even number of entries at
initialization (append a placeholder like "BYE" when count % 2 != 0) and update
the pairing loop at line 114 to iterate safely (use a stride step of 2 and guard
that both i and i+1 are within bounds or use min(teamNames.count, ...) to
compute pairs) so the code never accesses i+1 when it doesn't exist.

var mockGameSchedules: [GameSchedule] = []

for dayOffset in 0...6 {
let date = Calendar.current.date(byAdding: .day, value: dayOffset, to: Date())!
var games: [Game] = []

for index in 0...4 {
let homeTeamIndex = index * 2 % lckTeams.count
let awayTeamIndex = (index * 2 + 1) % lckTeams.count

let rotatedTeams: [String] = (0..<teamNames.count).map { teamNames[($0 + dayOffset) % teamNames.count] }
for pairIndex in stride(from: 0, to: rotatedTeams.count, by: 2) {
let homeTeam = rotatedTeams[pairIndex]
let awayTeam = rotatedTeams[pairIndex + 1]

let gameNumber = pairIndex / 2
let game = Game(
date: date,
homeTeam: lckTeams[homeTeamIndex].rawValue,
homeScore: index * 2 + 1,
awayTeam: lckTeams[awayTeamIndex].rawValue,
awayScore: index * 2 + 2,
homeTeam: homeTeam,
homeScore: gameNumber * 2 + 1,
awayTeam: awayTeam,
awayScore: gameNumber * 2 + 2,
status: .scheduled
)
games.append(game)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ final class GameScheduleCell: UICollectionViewCell {
$0.attributedText = "0".pretendardString(with: .head0)
$0.textColor = .wableBlack
}

private let versusLabel = UILabel().then {
Copy link
Member

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.

수정했습니다!

$0.attributedText = "VS".pretendardString(with: .head1)
$0.textColor = .wableBlack
}

private let awayTeamNameLabel = UILabel().then {
$0.attributedText = "TBD".pretendardString(with: .body3)
Expand Down Expand Up @@ -133,9 +138,10 @@ private extension GameScheduleCell {
scoreView.addSubviews(
homeTeamLogoImageView,
homeTeamNameLabel,
homeTeamScoreLabel,
colonImageView,
awayTeamScoreLabel,
// homeTeamScoreLabel,
// colonImageView,
// awayTeamScoreLabel,
versusLabel,
Comment on lines +141 to +144
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

주석 처리된 코드를 제거하세요.

뷰 계층 구성에서 주석 처리된 레이블들(homeTeamScoreLabel, colonImageView, awayTeamScoreLabel)을 완전히 제거하여 코드를 정리하세요.

다음 diff를 적용하세요:

         scoreView.addSubviews(
             homeTeamLogoImageView,
             homeTeamNameLabel,
-            // homeTeamScoreLabel,
-            // colonImageView,
-            // awayTeamScoreLabel,
             versusLabel,
             awayTeamNameLabel,
             awayTeamLogoImageView
         )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// homeTeamScoreLabel,
// colonImageView,
// awayTeamScoreLabel,
versusLabel,
scoreView.addSubviews(
homeTeamLogoImageView,
homeTeamNameLabel,
versusLabel,
awayTeamNameLabel,
awayTeamLogoImageView
)
🤖 Prompt for AI Agents
In Wable-iOS/Presentation/Overview/GameSchedule/View/Cell/GameScheduleCell.swift
around lines 141 to 144, remove the commented-out view items "//
homeTeamScoreLabel, // colonImageView, // awayTeamScoreLabel," from the
array/list where versusLabel is listed so the view hierarchy no longer contains
stale commented code; ensure no trailing commas or formatting issues remain and
run a quick build to confirm no other references to those commented identifiers
exist before committing.

awayTeamNameLabel,
awayTeamLogoImageView
)
Expand Down Expand Up @@ -177,19 +183,24 @@ private extension GameScheduleCell {
make.leading.equalTo(homeTeamLogoImageView.snp.trailing).offset(8)
}

homeTeamScoreLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.trailing.equalTo(colonImageView.snp.leading).offset(-24)
}

colonImageView.snp.makeConstraints { make in
/// 점수 레이블 숨김 처리로 인한 주석 처리
// homeTeamScoreLabel.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.trailing.equalTo(colonImageView.snp.leading).offset(-24)
// }

// colonImageView.snp.makeConstraints { make in
// make.center.equalToSuperview()
// make.adjustedWidthEqualTo(4)
// }

// awayTeamScoreLabel.snp.makeConstraints { make in
// make.centerY.equalToSuperview()
// make.leading.equalTo(colonImageView.snp.trailing).offset(24)
// }
Comment on lines +186 to +200
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

주석 처리된 제약조건 코드를 제거하세요.

주석 처리된 제약조건 코드는 더 이상 필요하지 않으며, 코드를 복잡하게 만듭니다. SwiftLint도 line 185의 고아 문서 주석에 대해 경고하고 있습니다.

다음 diff를 적용하여 주석 처리된 코드를 제거하세요:

         homeTeamNameLabel.snp.makeConstraints { make in
             make.centerY.equalToSuperview()
             make.leading.equalTo(homeTeamLogoImageView.snp.trailing).offset(8)
         }
         
-        /// 점수 레이블 숨김 처리로 인한 주석 처리
-        // homeTeamScoreLabel.snp.makeConstraints { make in
-        //     make.centerY.equalToSuperview()
-        //     make.trailing.equalTo(colonImageView.snp.leading).offset(-24)
-        // }
-        
-        // colonImageView.snp.makeConstraints { make in
-        //     make.center.equalToSuperview()
-        //     make.adjustedWidthEqualTo(4)
-        // }
-        
-        // awayTeamScoreLabel.snp.makeConstraints { make in
-        //     make.centerY.equalToSuperview()
-        //     make.leading.equalTo(colonImageView.snp.trailing).offset(24)
-        // }
-
         versusLabel.snp.makeConstraints { make in
             make.center.equalToSuperview()
         }
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 185-185: A doc comment should be attached to a declaration

(orphaned_doc_comment)

🤖 Prompt for AI Agents
Wable-iOS/Presentation/Overview/GameSchedule/View/Cell/GameScheduleCell.swift
around lines 185-199: remove the commented-out constraint code blocks (the three
commented makeConstraints closures for homeTeamScoreLabel, colonImageView, and
awayTeamScoreLabel) so there are no orphaned documentation comments; delete
those lines entirely and save the file, then run SwiftLint or build to confirm
the lint warning is resolved.


versusLabel.snp.makeConstraints { make in
make.center.equalToSuperview()
make.adjustedWidthEqualTo(4)
}

awayTeamScoreLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalTo(colonImageView.snp.trailing).offset(24)
}

awayTeamNameLabel.snp.makeConstraints { make in
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "100t.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "100t@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "100t@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "fox.png",
"filename" : "al.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "fox@2x.png",
"filename" : "al@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fox@3x.png",
"filename" : "al@3x.png",
Comment on lines +4 to +14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

팀 이름 변경이 일관되게 처리되었는지 확인하세요.

파일명이 fox에서 al로 변경되었습니다. 이전 fox 에셋 파일들이 제거되었거나 다른 곳에서 여전히 참조되고 있지 않은지 확인하시기 바랍니다.

다음 스크립트로 fox 관련 남은 참조를 확인하세요:


🏁 Script executed:

#!/bin/bash
# fox 에셋에 대한 남은 참조 확인
rg -i "fox" --type swift -C 2
fd "fox" --type f

Length of output: 212


Fox 에셋 제거/이름 변경 필요

  • Wable-iOS/Resource/Assets.xcassets/Tag/tag_Fox.imageset 디렉토리 내 Fox.png, Fox@2x.png, Fox@3x.png 파일들을 al 접두사로 변경하거나 불필요하다면 제거하세요.
🤖 Prompt for AI Agents
Wable-iOS/Resource/Assets.xcassets/Tag/tag_Fox.imageset around lines showing
image files (Fox.png, Fox@2x.png, Fox@3x.png): the three Fox image files should
either be renamed to use the "al" prefix (al.png, al@2x.png, al@3x.png) and
update the imageset Contents.json filenames accordingly, or delete the Fox files
and remove their entries from Contents.json if they are unnecessary; ensure
filenames, case, and Contents.json "filename" fields match exactly and that
there are no dangling references in the Xcode asset catalog.

"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "kdf.png",
"filename" : "blg.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "kdf@2x.png",
"filename" : "blg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "kdf@3x.png",
"filename" : "blg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/cfo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "cfo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "cfo@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "cfo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/fly.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "fly.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "fly@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fly@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/fnc.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "fnc.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "fnc@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "fnc@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/g2.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "g2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "g2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "g2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/ig.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "ig.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ig@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ig@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "mkoi.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mkoi@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mkoi@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/psg.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "psg.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "psg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "psg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/tes.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "tes.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tes@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tes@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
23 changes: 23 additions & 0 deletions Wable-iOS/Resource/Assets.xcassets/Team/tsw.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "tsw.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "tsw@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tsw@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading