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
22 changes: 22 additions & 0 deletions MatzipBook/MatzipBook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
05E5F5B32D956A6A00F0CB97 /* Sources */,
05E5F5B42D956A6A00F0CB97 /* Frameworks */,
05E5F5B52D956A6A00F0CB97 /* Resources */,
532A9B645B82AC22686798EF /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -178,6 +179,27 @@
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n";
};
532A9B645B82AC22686798EF /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MatzipBook/Pods-MatzipBook-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MatzipBook/Pods-MatzipBook-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MatzipBook/Pods-MatzipBook-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B3FD7D6A459785F2C512B25D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@

import UIKit

class BookmarkViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = UIColor.mainBackgroundColor
}
}
final class BookmarkViewController: BaseViewController {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// BaseViewController.swift
// MatzipBook
//
// Created by 심범수 on 6/8/25.
//

import UIKit

import SnapKit
import Then

class BaseViewController: UIViewController {
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

상속을 위한 접근 제어자 개선 필요

BaseViewController가 다른 모듈에서도 상속될 가능성을 고려하여 open class로 선언하는 것이 좋습니다.

-class BaseViewController: UIViewController {
+open class BaseViewController: UIViewController {
📝 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
class BaseViewController: UIViewController {
open class BaseViewController: UIViewController {
🤖 Prompt for AI Agents
In MatzipBook/MatzipBook/Presentation/Common/Base/BaseViewController.swift at
line 13, the BaseViewController class is declared as a default class, which
restricts inheritance outside the module. Change the class declaration from
'class' to 'open class' to allow other modules to inherit from
BaseViewController.


override func viewDidLoad() {
super.viewDidLoad()

setupStyles()
setupLayouts()
setupConstraints()
}

/// 뷰의 시각적 속성(스타일)을 설정합니다.
///
/// 이 메서드는 `backgroundColor`, `font`, `textColor`, `cornerRadius` 등
/// 레이아웃이나 계층 구조에 영향을 주지 않는 **시각적인 속성만을 설정**하는 데 사용됩니다.
///
/// 예:
/// ```swift
/// titleLabel.textColor = .labelPrimary
/// titleLabel.font = .systemFont(ofSize: 16, weight: .bold)
/// layer.cornerRadius = 12
/// ```
func setupStyles() {
view.backgroundColor = .mainBackgroundColor
}
Comment on lines +34 to +36
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

설정 메서드들의 접근 제어자 개선 필요

하위 클래스에서 이 메서드들을 오버라이드할 수 있도록 open func으로 선언하는 것이 좋습니다.

-    func setupStyles() {
+    open func setupStyles() {
         view.backgroundColor = .mainBackgroundColor
     }
     
-    func setupLayouts() {}
+    open func setupLayouts() {}
     
-    func setupConstraints() {}
+    open func setupConstraints() {}

Also applies to: 49-49, 63-63

🤖 Prompt for AI Agents
In MatzipBook/MatzipBook/Presentation/Common/Base/BaseViewController.swift at
lines 34-36, 49, and 63, the setup methods should be declared as open functions
instead of default or internal to allow subclasses to override them. Change the
access control of these methods to `open func` to enable overriding in
subclasses.


/// 뷰의 계층 구조를 설정합니다.
///
/// 이 메서드는 서브뷰를 상위 뷰에 추가하는 작업을 담당하며,
/// `addSubview`, `addArrangedSubview` 등을 통해 **뷰의 구조를 구성**합니다.
/// 일반적으로 제약 조건 설정 전에 호출됩니다.
///
/// 예:
/// ```swift
/// view.addSubview(titleLabel)
/// stackView.addArrangedSubview(subtitleLabel)
/// ```
func setupLayouts() {}

/// 오토레이아웃 제약 조건을 설정합니다.
///
/// 이 메서드는 뷰 간의 위치, 크기, 정렬 관계 등의 **제약 조건을 정의**합니다.
/// `setupLayouts()` 이후 호출되어야 하며, 레이아웃의 정확한 동작을 위해 필수입니다.
///
/// 예:
/// ```swift
/// titleLabel.snp.makeConstraints {
/// $0.top.equalToSuperview().inset(16)
/// $0.leading.trailing.equalToSuperview().inset(20)
/// }
/// ```
func setupConstraints() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@

import UIKit

class HomeViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = UIColor.mainBackgroundColor
}
}
final class HomeViewController: BaseViewController {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@

import UIKit

class MapViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = UIColor.mainBackgroundColor
}
}
final class MapViewController: BaseViewController {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@

import UIKit

class ProfileViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = UIColor.mainBackgroundColor
}
}
final class ProfileViewController: BaseViewController {}
2 changes: 2 additions & 0 deletions MatzipBook/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ target 'MatzipBook' do

# Pods for MatzipBook
pod 'SwiftLint'
pod 'SnapKit'
pod 'Then'

post_install do |installer|
installer.pods_project.targets.each do |target|
Expand Down
10 changes: 9 additions & 1 deletion MatzipBook/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
PODS:
- SnapKit (5.7.1)
- SwiftLint (0.59.1)
- Then (3.0.0)

DEPENDENCIES:
- SnapKit
- SwiftLint
- Then

SPEC REPOS:
trunk:
- SnapKit
- SwiftLint
- Then

SPEC CHECKSUMS:
SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
SwiftLint: 3d48e2fb2a3468fdaccf049e5e755df22fb40c2c
Then: 844265ae87834bbe1147d91d5d41a404da2ec27d

PODFILE CHECKSUM: 2654d5e3e6997c854ff1671419d73ca19518ac76
PODFILE CHECKSUM: 5dc0ecf6f2fa41dbae9b05051d76c36bdab74fdd

COCOAPODS: 1.16.2