Skip to content

Commit 65a0128

Browse files
committed
Refactor: 코드리뷰 반영
1 parent 761a6bc commit 65a0128

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Projects/Presentation/Sources/Tutorial/View/TutorialDetailViewController.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ final class TutorialDetailViewController: UIViewController {
4545
}
4646

4747
private func configureAttribute() {
48+
view.backgroundColor = BitnagilColor.gray99
49+
4850
titleLabel.text = tutorial.title
4951
titleLabel.font = BitnagilFont(style: .title3, weight: .semiBold).font
5052
titleLabel.textColor = BitnagilColor.gray10
@@ -60,7 +62,6 @@ final class TutorialDetailViewController: UIViewController {
6062

6163
private func configureLayout() {
6264
let safeArea = view.safeAreaLayoutGuide
63-
view.backgroundColor = BitnagilColor.gray99
6465

6566
view.addSubview(titleLabel)
6667
view.addSubview(descriptionLabel)
@@ -74,15 +75,17 @@ final class TutorialDetailViewController: UIViewController {
7475

7576
descriptionLabel.snp.makeConstraints { make in
7677
make.top.equalTo(titleLabel.snp.bottom).offset(Layout.descriptionLabelTopSpacing)
77-
make.leading.equalTo(safeArea).offset(Layout.horizontalMargin)
78-
make.trailing.equalTo(safeArea).inset(Layout.horizontalMargin)
78+
make.horizontalEdges.equalTo(safeArea).inset(Layout.horizontalMargin)
7979
make.height.equalTo(Layout.descriptionLabelHeight)
8080
}
8181

8282
tutorialImage.snp.makeConstraints { make in
8383
make.top.equalTo(descriptionLabel.snp.bottom).offset(Layout.tutorialImageTopSpacing)
84-
make.leading.equalTo(safeArea).offset(Layout.horizontalMargin)
85-
make.trailing.equalTo(safeArea).inset(Layout.horizontalMargin)
84+
make.horizontalEdges.equalTo(safeArea).inset(Layout.horizontalMargin)
85+
if let image = tutorialImage.image {
86+
let aspectRatio = image.size.height / image.size.width
87+
make.height.equalTo(tutorialImage.snp.width).multipliedBy(aspectRatio)
88+
}
8689
}
8790
}
8891
}

Projects/Presentation/Sources/Tutorial/View/TutorialViewController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ final class TutorialViewController: UIViewController {
2727
}
2828

2929
private func configureAttribute() {
30+
view.backgroundColor = .systemBackground
31+
navigationController?.setNavigationBarHidden(true, animated: false)
32+
configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "설명서"))
33+
3034
tutorialTableView.delegate = self
3135
tutorialTableView.dataSource = self
3236

@@ -37,15 +41,11 @@ final class TutorialViewController: UIViewController {
3741

3842
private func configureLayout() {
3943
let safeArea = view.safeAreaLayoutGuide
40-
view.backgroundColor = .systemBackground
41-
navigationController?.setNavigationBarHidden(true, animated: false)
42-
configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "설명서"))
4344

4445
view.addSubview(tutorialTableView)
4546
tutorialTableView.snp.makeConstraints { make in
4647
make.top.equalTo(safeArea).offset(Layout.tutorialTableViewTopSpacing)
47-
make.leading.equalTo(safeArea).offset(Layout.horizontalMargin)
48-
make.trailing.equalTo(safeArea).offset(-Layout.horizontalMargin)
48+
make.horizontalEdges.equalTo(safeArea).inset(Layout.horizontalMargin)
4949
make.bottom.equalTo(safeArea)
5050
}
5151
}

0 commit comments

Comments
 (0)