-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feat] 7차 세미나 과제 #7
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확실히 코드가 많이 깔끔해져서 보기도 너무 좋네요 😊
폴더링도 코드도 MVC, MVVM 패턴을 잘 적용한 것 같습니다:-)
코드에 통일성이 있었으면 좋을 것 같아요. 예를들어 접근제어자 통일, 함수 분리, 네이밍 등등이요!
Extension 코드를 좀 더 활용하면 좋을 것 같습니다 ㅎㅎ
리펙토링 하시느라 너무 고생 많으셨습니다!! 앱잼 화이팅 🔥🔥
func bindUserId(id: String) | ||
} | ||
|
||
class LoginViewController: UIViewController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final 키워드 붙여주면 좋을 것 같아요!
import SnapKit | ||
|
||
final class LoginView: UIView { | ||
// MARK: - Component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 컴포넌트들에 접근제어자를 따로 붙이지 않은 이유가 있을까요?
만약 특별한 이유가 없다면, private 접근제어자를 지정해주는게 좋을 것 같아요!
makeNicknameButton | ||
) | ||
|
||
idTextFieldRightView.addSubviews(idClearButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addSubView로 수정해주세용
pwTextFieldRightView.addSubviews(pwShowButton, pwClearButton) | ||
|
||
|
||
titleLabel.snp.makeConstraints { make in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레이아웃을 잡는 부분은 따로 함수로 빼면 가독성이 좋아질 것 같아요!
func setLayout() {
// 코드
}
make.centerY.equalToSuperview() | ||
make.centerX.equalToSuperview() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make.center.equalToSuperview()
로 해주셔도 똑같습니당
import UIKit | ||
|
||
import SnapKit | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import Then 해주세용
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
self.backgroundColor = .clear | ||
setUI() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required init에는 super.init(coder: coder)만 작성해주셔도 됩니당!
var movies: [String] = [] { | ||
didSet { | ||
self.onMoviesUpdated?() | ||
} | ||
} | ||
|
||
var onMoviesUpdated: (() -> Void)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 넘 좋네용 😎
DispatchQueue.main.async { | ||
self?.movies = movieNames | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DispatchQueue를 사용하신 이유가 있을까용?
setCollectionView() | ||
} | ||
|
||
private static func createFlowLayout() -> UICollectionViewFlowLayout { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static 키워드를 사용하신 이유가 무엇인가용??
🔍 What is the PR?
📍 PR Point
HomeViewController 분리
HomeViewController를 MVC 패턴으로 분리한 과정은 다음과 같습니다.
HomeViewController
의rootView
를HomeView()
로 선언하며View
에 해당하는 부분을HomeView()
로 분리했습니다.CollectionView
와navigationView
컴포넌트가 있고, 각 컴포넌트 또한 별도의 파일로 분리했습니다.MMVM 패턴 적용
Presentation > MovieRank
에 있습니다.MovieRankViewController
에서 구현한 기능은 버튼을 누르면 영화순위가 나오는 간단한 뷰입니다.MovieRankViewController
에서 비즈니스 로직을 분리하여MovieViewModel
을 작성했습니다.🙏 To Reviewers
MovieViewModel
,MovieRankViewController
가 MVVM 패턴을 적절하게 적용한 것이 맞는지 피드백 부탁드립니다.💭 Related Issues