Skip to content
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

박스오피스II [STEP 2] BMO, Serena #108

Open
wants to merge 24 commits into
base: ic_9_serena
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
113405e
refactor: 이름변경 setUp -> setup
bubblecocoa Aug 11, 2023
c849b5f
test: override 메서드 이름 오탈자 수정
bubblecocoa Aug 11, 2023
2258a6c
refactor: 이름 변경 set -> setup
bubblecocoa Aug 11, 2023
49aef8a
docs: 3주차 README 작성
serena0720 Aug 11, 2023
2f8710c
refactor: BoxOfficeCell에서 BoxOfficeListCell로 변경
serena0720 Aug 15, 2023
a4fe9c5
feat: NavigationController Toolbar Button 생성 및 Action 함수 선언
serena0720 Aug 15, 2023
676316c
refactor: CellRegistration 시 BoxOfficeCell에서 BoxOfficeListCell로 타입 변경
serena0720 Aug 15, 2023
bab06cd
feat: BoxOfficeColumnCell 생성
bubblecocoa Aug 15, 2023
bc06c9e
refactor: CellRegistration에 BoxOfficeListCell 타입 적용
bubblecocoa Aug 15, 2023
3a83403
chore: 주석 내용 변경
bubblecocoa Aug 15, 2023
04cefb4
refactor: DetailLabel 파라미터 수정 및 적용
serena0720 Aug 15, 2023
66aec3a
refactor: movieNameLabel과 audienceCountLabel 분리함에 따라 BoxOfficeListCel…
serena0720 Aug 15, 2023
8c6a7da
refactor: BoxOfficeListCell의 contentStackView bottom constraint 추가
serena0720 Aug 15, 2023
5bc3354
refactor: BoxOfficeColumnCell 제약사항 변경
bubblecocoa Aug 15, 2023
c9efcd0
feat: list <-> icon 화면 변경 로직 작성
bubblecocoa Aug 15, 2023
5bcf568
chore: 컨벤션 수정 및 네이밍 수정
serena0720 Aug 15, 2023
1c25e16
feat: ViewMode 열거형, UserDefaults 확장 생성 및 적용
bubblecocoa Aug 16, 2023
49503c9
refactor: listCellRegistration, iconCellRegistration 읽기 전용 프로퍼티로 분리 및 적용
serena0720 Aug 16, 2023
a203037
refactor: collectionView 모드 변경 시 애니메이션 효과 추가
serena0720 Aug 16, 2023
6decb2d
refactor: 중복코드 제거
bubblecocoa Aug 16, 2023
2476fff
refactor: 커밋 누락 추가
bubblecocoa Aug 16, 2023
04f4e8a
refactor: BoxOfficeIconCell로 네이밍 통일
serena0720 Aug 16, 2023
1f14cf0
refactor: 현재 스크롤 위치를 화면 모드 변경시 반영되도록 수정
bubblecocoa Aug 18, 2023
7023922
refactor: ViewMode의 case가 toggle 값을 가지도록 네이밍 수정 및 원시값 작성
bubblecocoa Aug 18, 2023
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
20 changes: 16 additions & 4 deletions BoxOffice.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
CB30DA0D2A8480B7002DE804 /* CalendarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA0C2A8480B7002DE804 /* CalendarViewController.swift */; };
CB30DA0F2A850C1B002DE804 /* CalendarViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA0E2A850C1B002DE804 /* CalendarViewControllerDelegate.swift */; };
CB30DA112A8517C6002DE804 /* DateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA102A8517C6002DE804 /* DateManager.swift */; };
CB30DA842A8B0976002DE804 /* BoxOfficeIconCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA832A8B0976002DE804 /* BoxOfficeIconCell.swift */; };
CB30DA862A8C925F002DE804 /* ViewMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA852A8C925F002DE804 /* ViewMode.swift */; };
CB30DA882A8C9294002DE804 /* UserDefaults+.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30DA872A8C9294002DE804 /* UserDefaults+.swift */; };
CB31F7C62A738376001E9B21 /* CustomDateFormatStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB31F7C52A738376001E9B21 /* CustomDateFormatStyle.swift */; };
CB31F7C82A738397001E9B21 /* MimeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB31F7C72A738397001E9B21 /* MimeType.swift */; };
CB4CFDD32A6FA25200288EFA /* BoxOfficeResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB4CFDD22A6FA25200288EFA /* BoxOfficeResultTests.swift */; };
Expand All @@ -35,7 +38,7 @@
D20B9F502A8214500035DEC4 /* KakaoNameSpace.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20B9F4F2A8214500035DEC4 /* KakaoNameSpace.swift */; };
D20B9F522A8245130035DEC4 /* ImageCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20B9F512A8245130035DEC4 /* ImageCacheManager.swift */; };
D20B9F5B2A8356A20035DEC4 /* TitleLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D20B9F5A2A8356A20035DEC4 /* TitleLabel.swift */; };
D22F99682A79ECEE002EAE5E /* BoxOfficeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D22F99672A79ECEE002EAE5E /* BoxOfficeCell.swift */; };
D22F99682A79ECEE002EAE5E /* BoxOfficeListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D22F99672A79ECEE002EAE5E /* BoxOfficeListCell.swift */; };
D236E1952A7342FD003D0F7A /* Movie.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E1942A7342FD003D0F7A /* Movie.swift */; };
D236E1972A73430E003D0F7A /* MovieInfoResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E1962A73430E003D0F7A /* MovieInfoResult.swift */; };
D236E1992A73431B003D0F7A /* MovieInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E1982A73431B003D0F7A /* MovieInfo.swift */; };
Expand Down Expand Up @@ -88,6 +91,9 @@
CB30DA0C2A8480B7002DE804 /* CalendarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewController.swift; sourceTree = "<group>"; };
CB30DA0E2A850C1B002DE804 /* CalendarViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewControllerDelegate.swift; sourceTree = "<group>"; };
CB30DA102A8517C6002DE804 /* DateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateManager.swift; sourceTree = "<group>"; };
CB30DA832A8B0976002DE804 /* BoxOfficeIconCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoxOfficeIconCell.swift; sourceTree = "<group>"; };
CB30DA852A8C925F002DE804 /* ViewMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewMode.swift; sourceTree = "<group>"; };
CB30DA872A8C9294002DE804 /* UserDefaults+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+.swift"; sourceTree = "<group>"; };
CB31F7C52A738376001E9B21 /* CustomDateFormatStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDateFormatStyle.swift; sourceTree = "<group>"; };
CB31F7C72A738397001E9B21 /* MimeType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MimeType.swift; sourceTree = "<group>"; };
CB4CFDD12A6FA16900288EFA /* BoxOfficeTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = BoxOfficeTestPlan.xctestplan; sourceTree = "<group>"; };
Expand All @@ -101,7 +107,7 @@
D20B9F4F2A8214500035DEC4 /* KakaoNameSpace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KakaoNameSpace.swift; sourceTree = "<group>"; };
D20B9F512A8245130035DEC4 /* ImageCacheManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCacheManager.swift; sourceTree = "<group>"; };
D20B9F5A2A8356A20035DEC4 /* TitleLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleLabel.swift; sourceTree = "<group>"; };
D22F99672A79ECEE002EAE5E /* BoxOfficeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoxOfficeCell.swift; sourceTree = "<group>"; };
D22F99672A79ECEE002EAE5E /* BoxOfficeListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoxOfficeListCell.swift; sourceTree = "<group>"; };
D236E1942A7342FD003D0F7A /* Movie.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Movie.swift; sourceTree = "<group>"; };
D236E1962A73430E003D0F7A /* MovieInfoResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieInfoResult.swift; sourceTree = "<group>"; };
D236E1982A73431B003D0F7A /* MovieInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MovieInfo.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -279,7 +285,8 @@
isa = PBXGroup;
children = (
D20B9F592A8356810035DEC4 /* Custom */,
D22F99672A79ECEE002EAE5E /* BoxOfficeCell.swift */,
D22F99672A79ECEE002EAE5E /* BoxOfficeListCell.swift */,
CB30DA832A8B0976002DE804 /* BoxOfficeIconCell.swift */,
D2D027CF2A7F293A00456444 /* MovieDetailView.swift */,
);
path = View;
Expand Down Expand Up @@ -328,6 +335,7 @@
children = (
CBC61F8D2A6EA42D00FDAD18 /* DTO */,
D2D027C72A7BD54E00456444 /* Section.swift */,
CB30DA852A8C925F002DE804 /* ViewMode.swift */,
);
path = Model;
sourceTree = "<group>";
Expand All @@ -349,6 +357,7 @@
D2D027C92A7BD57800456444 /* String+.swift */,
D2D027D12A813B7A00456444 /* UIFont+.swift */,
CB289C0C2A81C897007EBADA /* Bundle+.swift */,
CB30DA872A8C9294002DE804 /* UserDefaults+.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -459,10 +468,11 @@
D2E159472A6EA6EC00052F8B /* DailyBoxOffice.swift in Sources */,
D20B9F5B2A8356A20035DEC4 /* TitleLabel.swift in Sources */,
CB289C022A7F319F007EBADA /* DaumSearchMainText.swift in Sources */,
CB30DA842A8B0976002DE804 /* BoxOfficeIconCell.swift in Sources */,
CBEF1EE12A6F8909005459DD /* BoxOffice.swift in Sources */,
CB289C0D2A81C897007EBADA /* Bundle+.swift in Sources */,
D20B9F4E2A820C800035DEC4 /* AlertManager.swift in Sources */,
D22F99682A79ECEE002EAE5E /* BoxOfficeCell.swift in Sources */,
D22F99682A79ECEE002EAE5E /* BoxOfficeListCell.swift in Sources */,
D266DEC22A72269200DBB07F /* NetworkManager.swift in Sources */,
D236E1972A73430E003D0F7A /* MovieInfoResult.swift in Sources */,
CB31F7C62A738376001E9B21 /* CustomDateFormatStyle.swift in Sources */,
Expand All @@ -472,12 +482,14 @@
CB30DA092A8359FF002DE804 /* DetailLabel.swift in Sources */,
D2D027CA2A7BD57800456444 /* String+.swift in Sources */,
CB31F7C82A738397001E9B21 /* MimeType.swift in Sources */,
CB30DA882A8C9294002DE804 /* UserDefaults+.swift in Sources */,
CB30DA0F2A850C1B002DE804 /* CalendarViewControllerDelegate.swift in Sources */,
D2A6AE482A73AA0100CE5903 /* NetworkManagerError.swift in Sources */,
D277169E2A6FFFAC005C0045 /* JSONDecoderError.swift in Sources */,
CB289C042A7F31C2007EBADA /* DaumSearchMeta.swift in Sources */,
D236E1B22A7356EA003D0F7A /* KobisNameSpace.swift in Sources */,
D2D027D22A813B7A00456444 /* UIFont+.swift in Sources */,
CB30DA862A8C925F002DE804 /* ViewMode.swift in Sources */,
CB30DA072A83555D002DE804 /* MovieDetailNameSpace.swift in Sources */,
CB30DA0D2A8480B7002DE804 /* CalendarViewController.swift in Sources */,
63DF20F32970E1A0005DF7D1 /* BoxOfficeViewController.swift in Sources */,
Expand Down
19 changes: 19 additions & 0 deletions BoxOffice/Extension/UserDefaults+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// UserDefaults+.swift
// BoxOffice
//
// Created by Serena, BMO on 2023/08/16.
//

import Foundation

extension UserDefaults {
Copy link
Member

Choose a reason for hiding this comment

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

오... 디테일한 부분까지 신경쓰셨군요 👍

private enum UserDefaultsKeys: String {
case viewMode
}

var viewMode: String {
get { string(forKey: UserDefaultsKeys.viewMode.rawValue) ?? ViewMode.list.rawValue }
set { setValue(newValue, forKey: UserDefaultsKeys.viewMode.rawValue) }
}
}
20 changes: 20 additions & 0 deletions BoxOffice/Model/ViewMode.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ViewMode.swift
// BoxOffice
//
// Created by Serena, BMO on 2023/08/16.
//

enum ViewMode: String {
case list
case icon

var anotherOption: String {
Copy link
Member

Choose a reason for hiding this comment

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

anotherOption이란 네이밍이 조금 어색해보이는데 탄생하게된 배경이 궁금합니다! 🙋🏻

Choose a reason for hiding this comment

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

7023922
해당부분 저희도 어색해하던 부분이라 좀 더 고민 후 수정했습니다 😄

switch self {
case .list:
return "아이콘"
case .icon:
return "리스트"
}
}
}
105 changes: 0 additions & 105 deletions BoxOffice/View/BoxOfficeCell.swift

This file was deleted.

75 changes: 75 additions & 0 deletions BoxOffice/View/BoxOfficeIconCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//
// BoxOfficeIconCell.swift
// BoxOffice
//
// Created by Serena, BMO on 2023/08/15.
//

import UIKit

final class BoxOfficeIconCell: UICollectionViewListCell {
static let identifier = "boxOfficeIconCell"

// MARK: - InformationStackView
private let contentStackView: UIStackView = {
let stackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.alignment = .center
stackView.distribution = .fillEqually

return stackView
}()

let rankLabel: UILabel = {
let label = UILabel()
label.font = UIFont.preferredFont(forTextStyle: .title1)
label.adjustsFontForContentSizeCategory = true
label.adjustsFontSizeToFitWidth = true

return label
}()

let movieNameLabel: UILabel = DetailLabel(fontStyle: .body)
let rankInformationLabel: UILabel = DetailLabel(fontStyle: .body)
let audienceCountLabel: UILabel = DetailLabel(fontStyle: .caption1)

override init(frame: CGRect) {
super.init(frame: frame)
configureIconCell()
}

required init?(coder: NSCoder) {
fatalError("not implemnted")
}
}

// MARK: - Constraints
extension BoxOfficeIconCell {
private func configureIconCell() {
configureUI()
setupConstraints()
}

private func configureUI() {
addSubview(contentStackView)
Copy link
Member

Choose a reason for hiding this comment

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

contentView.addSubview(contentStackView) 처럼 사용할때와 어떤 차이가 있을까요~?
만약 있다면 어떤 방법이 레이아웃 관리에 좀 더 도움이 될까요!? 🙋🏻


contentStackView.addArrangedSubview(rankLabel)
contentStackView.addArrangedSubview(movieNameLabel)
contentStackView.addArrangedSubview(rankInformationLabel)
contentStackView.addArrangedSubview(audienceCountLabel)
}

private func setupConstraints() {
setupContentStackViewConstraints()
}

private func setupContentStackViewConstraints() {
NSLayoutConstraint.activate([
contentStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 4),
contentStackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -4),
contentStackView.topAnchor.constraint(equalTo: topAnchor, constant: 4),
contentStackView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -4)
])
}
}
Loading