Skip to content

[Lv 1] 메인뷰 UI 구현 - Tot#7

Open
HwangSeokBeom wants to merge 17 commits into5NTeam:Totfrom
HwangSeokBeom:main
Open

[Lv 1] 메인뷰 UI 구현 - Tot#7
HwangSeokBeom wants to merge 17 commits into5NTeam:Totfrom
HwangSeokBeom:main

Conversation

@HwangSeokBeom
Copy link
Collaborator

과제 UI
image

내가 만든 UI
image

Copy link
Collaborator

@Crois0509 Crois0509 left a comment

Choose a reason for hiding this comment

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

일부 코드가 누락이 된건지 어떤지 모르지만...
어떤 느낌인지 대충 감이 오네요!!
구현 고생하셨습니다~

import UIKit
import SnapKit

class PhoneBookViewController: UIViewController {
Copy link
Collaborator

Choose a reason for hiding this comment

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

PhoneBookViewController는 연락처 추가 화면의 뷰 컨트롤러 이름으로 설정해 달라고 했던 것 같아요!!
테이블뷰가 있는 연락처 목록을 보여주는 뷰 컨트롤러는 다른 이름으로 하시는게 좋을 것 같네요ㅎㅎ

Comment on lines 14 to 15
private var contacts: [Contact] = []
private let contactManager = ContactManager()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Contact라는 클래스를 찾을 수가 없네요...
어떤 역할인가요? 보기에는 테이블뷰의 데이터소스와 관련된 작업을 하는 것 같은데, 알려주세요!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

PhoneBook으로 데이터 저장하는 구조체 모델로 만들었습니다!

Copy link
Collaborator

@Crois0509 Crois0509 left a comment

Choose a reason for hiding this comment

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

레벨 8까지 구현 잘 봤습니다!!
레벨 5에서 연락처 저장을 구현 예정이라고 하셨던데 이미 구현하신거겠죠!?

코드의 구조를 파악하는데 어려움이 없는 좋은 코드였습니다!!
이제 예외사항을 생각해보며 하나씩 처리해보죠!!


import Foundation

struct PokemonModel: Decodable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

어차피 디코딩만 하는 모델이니까 애초에 Decodable만 쓰셨군요!!
좋습니다~

}()

private let nameTextField: UITextField = {
let textField = UITextField()
Copy link
Collaborator

Choose a reason for hiding this comment

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

UITextView가 아닌 UITextField로 선택하신 이유가 있으신가요?

Comment on lines 21 to 27
let button = UIButton()
button.setTitle("랜덤 이미지 생성", for: .normal)
button.setTitleColor(.lightGray, for: .normal)
button.titleLabel?.font = .systemFont(ofSize: 20, weight: .light)
button.backgroundColor = .clear
button.addTarget(self, action: #selector(createButtonTapped), for: .touchUpInside)
return button
Copy link
Collaborator

Choose a reason for hiding this comment

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

버튼을 구현하는 방식 중에 UIButton.configuration이 있다는 걸 알고 계시나요??
좀 더 커스텀하게 버튼을 만들 수 있는 방법이니 공부해 보셔도 좋을 것 같아요!!

Comment on lines 45 to 52
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
let appDelegate = UIApplication.shared.delegate as! AppDelegate
self.container = appDelegate.persistentContainer
setupNavigationBar()
setupLayout()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

코드가 너무 뭉쳐 있으니 가독성이 떨어지는 것 같아요!
연관 있는 코드만 붙여두고 나머지는 개행을 줘서 구분감을 주면 어떨까요?

Comment on lines 150 to 154
let addVC = AddViewController()
addVC.phoneBook = phoneBook
addVC.isEditingMode = true
self.tableView.reloadData()
navigationController?.pushViewController(addVC, animated: true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

뷰 컨트롤러를 인스턴스화 시켜서 사용하는 시도 좋습니다~
혹시 다른 방법도 있을까요?

Crois0509 added a commit that referenced this pull request Dec 12, 2024
✨[Feat] 테이블뷰 셀 알파벳순 정렬 기능
test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants