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

레시피 리스트UI를 생성해보았습니다. #9

Merged
merged 36 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6764431
Feat: SearchBar 정의
GeonH0 Jun 19, 2024
10c4c85
Feat: RecipeListView 정의
GeonH0 Jun 19, 2024
69b6ba0
Feat: RecipeListCell 정의
GeonH0 Jun 19, 2024
b740a44
Feat: RecipeListViewController 정의
GeonH0 Jun 19, 2024
68d17da
Fix: ViewModel을 Interactor로 변경해서 ViewController에 적용
GeonH0 Jun 24, 2024
145bd41
Fix: SearchBar final 처리
GeonH0 Jun 24, 2024
db5e2ef
Fix: searchText에 retrun제거
GeonH0 Jun 24, 2024
7a3ba89
Fix: RecipeListView에 final 추가
GeonH0 Jun 24, 2024
db38695
Fix: RecipeListViewCell에 final 추가
GeonH0 Jun 24, 2024
22ee02b
Fix: collectionView를 private 처리
GeonH0 Jun 24, 2024
6edb8bb
Fix: recipelistView를 recipeListView로 네이밍 변경
GeonH0 Jun 24, 2024
2a6372c
Fix: SearchBar 선언 수정
GeonH0 Jun 24, 2024
2be84eb
Fix: 마진 값을 변수로 뺌
GeonH0 Jun 25, 2024
ee35fb9
Fix: imageView 네이밍 변경
GeonH0 Jun 25, 2024
34985f7
Feat: Fonts 객체 정의
GeonH0 Jun 25, 2024
24d0856
Fix: Fonts 객체 적용
GeonH0 Jun 25, 2024
24a71e2
Fix: 이미지 설정코드 setupUI로 이동
GeonH0 Jun 25, 2024
72e9fe8
Feat: loadImage메서드를 extension으로 분리
GeonH0 Jun 25, 2024
cf0c78c
Fix: extension으로 분리된 loadImage 적용
GeonH0 Jun 25, 2024
15f80f0
Fix: RecipeListViewController final 추가
GeonH0 Jun 25, 2024
833b474
Fix: RecipeListViewModelDelegate을 extension으로 확장
GeonH0 Jun 25, 2024
be060c4
Feat: String extenstion에 isBlank 프러퍼티를 추가
GeonH0 Jun 25, 2024
99c274e
Fix: String extenstion에 isBlank 프러퍼티 적용
GeonH0 Jun 25, 2024
c0bd5a0
Fix: didFetchRecipes를 fetchedRecipes로 네이밍 변경
GeonH0 Jun 25, 2024
05b2a58
Merge branch 'main' into feature/feedListView
GeonH0 Jun 25, 2024
52d89ea
Fix: 핸들러에 [weak self] 추가
GeonH0 Jun 25, 2024
1a760ca
Fix: Metric 적용
GeonH0 Jun 26, 2024
3c03347
Fix: 불필요한 return 제거
GeonH0 Jun 29, 2024
7077713
Fix: ViewController에 UICollectionViewDataSource와 UICollectionViewDel…
GeonH0 Jul 1, 2024
c1bc9a0
Fix: RecipeListView에 UICollectionViewDataSource,UICollectionViewDeleg…
GeonH0 Jul 1, 2024
4eb8154
Fix: RecipeListInteractor에서 mapping 기능 제거, result타입으로 전달해서 에러 처리
GeonH0 Jul 1, 2024
e57455d
Fix: Delegate에 didFail제거, 상세화면을 보여주는 메서드 showRecipeDetail정의
GeonH0 Jul 1, 2024
f0115b8
Feat: RecipeListViewDelegate정의,RecipeListInteractorDelegate정의
GeonH0 Jul 1, 2024
d3dcc4e
Fix: Mark 추가
GeonH0 Jul 1, 2024
76fdeba
Feat: 기본 이미지 추가
GeonH0 Jul 1, 2024
e1a3fc2
Fix: RecipeListViewCell에서 기본 이미지 설정
GeonH0 Jul 1, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// RecipeListView.swift
// HomeCafeRecipes
//
// Created by 김건호 on 6/10/24.
//

import UIKit

class RecipeListView: UIView {

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.

[7a3ba89] 변경했습니다


let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())

Choose a reason for hiding this comment

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

collectionView를 internal로 선언한 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ViewController에서
recipelistView.collectionView.dataSource = self
recipelistView.collectionView.delegate = self
이런식으로 선언하다보니 캡슐화를 놓친거 같습니다 변경하겠습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[22ee02b] 수정했습니다

Choose a reason for hiding this comment

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

delegate와 dataSource는 view에서 같이 구현

Choose a reason for hiding this comment

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

@GeonH0 이 부분은 아직 수정전이신가요~?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@f-lab-barry 내일 오전 중으로 수정 커밋 올리겠습니다!

Copy link
Collaborator Author

@GeonH0 GeonH0 Jul 1, 2024

Choose a reason for hiding this comment

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

[7077713],[c1bc9a0],[f0115b8] 수정했습니다


override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
setupLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func setupUI() {
backgroundColor = .white
addSubview(collectionView)
collectionView.register(RecipeListViewCell.self, forCellWithReuseIdentifier: "RecipeCell")
configureCollectionView()
}

private func setupLayout() {
collectionView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
collectionView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor),
collectionView.leadingAnchor.constraint(equalTo: leadingAnchor),
collectionView.trailingAnchor.constraint(equalTo: trailingAnchor),
collectionView.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor)
])
}

private func configureCollectionView() {
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: UIScreen.main.bounds.width - 20, height: 200)

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.

[2be84eb] 변경했습니다

layout.minimumLineSpacing = 10
layout.minimumInteritemSpacing = 10
collectionView.collectionViewLayout = layout
}
}