Skip to content

Conversation

@chaeyoon1101
Copy link

@chaeyoon1101 chaeyoon1101 commented Oct 6, 2022

@jaemuYeo 리뷰 부탁드립니다 😃

STEP 2에서 구현한 것들

  • STEP 1에서 구현한 JSON 포멧의 데이터와 매칭할 모델 타입을 통해 JSON 파싱
  • ScrollVIew를 통해 박람회의 설명과 출품작의 긴 설명들을 스크롤을 통하여 볼 수 있게 구현
  • TableView를 통해 출품작 목록화면을 구현
  • navigation Controller를 통하여 화면간 이동을 구현
  • prepare메서드를 사용하여 화면간 이동시 데이터 전달 구현

STEP 2를 진행하면서 궁금했던 것들

  • 화면 간 이동을 navigation Controller를 통하여 구현을 하였는데 메인 화면인 박람회를 설명하는 화면에서는 navigationbar가 있지 않아서 navigationbar는 만든 후 코드에서
override func viewWillAppear(_ animated: Bool) {
    self.navigationController?.navigationBar.isHidden = true
}

위와 같이 숨겨준 뒤 다른 화면인 출품작과 출품작 상세화면에선 다시 값을 false를 넣어주어서 navigationBar가 나타나도록 구현했습니다. 이러한 방식말고도 다른 방법이 있을까요?

  • 출품작화면에서 cell을 클릭해 상세화면으로 이동할 때 데이터를 전달하는 방식을 prepare메서드를 사용하여 구현했습니다. 이러한 방식 말고도 didSelectRowAt 메서드를 통하여 데이터를 전달하는 방식과 같이 여러 방법이 있는데 애플이 권장하는 데이터 전달 방법이나 잼킹이 선호하는 뷰 컨트롤러간 데이터 전달 방법이 있을까요?

  • 화면의 UI들을 스토리보드에서 만든 후 Label이나 imageView의 값들을 코드에서 넣어줄 경우에 스토리보드에서의 Label의 기본 값인 Label로 놔두는지 따로 설명해주는 글들을 넣어주는 지 궁금합니다
    (아래의 첫번째 사진은 기본 값인 Label을 넣은 경우 두번째 사진은 무엇을 넣을 Label인지 설명하는 경우)

스크린샷 2022-10-06 오전 10 37 52 스크린샷 2022-10-06 오전 10 38 45

Copy link
Contributor

@jaemuYeo jaemuYeo left a comment

Choose a reason for hiding this comment

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

우루프 스텝2도 고생많았습니다 !!👏
이번 스텝의 목표에 맞게 데이터를 잘 파싱했군요!
다만 몇 가지 코멘트를 통해 반영해보면 좋겠다 생각이들어서 남겨놓겠습니다 ㅎㅎ

질문에 대한 의견

  1. 네비게이션 바 숨김 관련
    지금 구현하신 방법도 틀린 방법은 아닙니다 🙂
    다만 제가 구현한다면 Main뷰에서
  • 뷰가 나타때 - 네비게이션 바 숨김
  • 뷰가 사라질때 - 네비게이션 바 생김
    으로 MainVC에서만으로 조작할 거같아요!!
  1. 화면간 데이터 전달방식
    이것또한 정답은 없습니다! 누가 선호한다기 보다는 상황에 맞게 쓰시면 됩니다~
    굳이 꼽자면 저는 딜리게이트를 통한 데이터전달을 선호합니다 ☺️

  2. 스토리보드 Label
    그냥 Label로 두셔도 됩니다!! 가끔가다 괜히 건드려서 스토리보드와 코드간에 충돌이 발생하기도 해요~

C79FF4B82589F401005FB0FD /* ViewController.swift */,
C79FF4B62589F401005FB0FD /* SceneDelegate.swift */,
C79FF4B42589F401005FB0FD /* AppDelegate.swift */,
2BA683FC28EC05AB00A58B88 /* ExhibitionViewController.swift */,
Copy link
Contributor

Choose a reason for hiding this comment

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

파일위치를 수정하면 좋을 거같아요! 커스텀 셀과 앱,씬 딜리게이트, 뷰컨트롤러들끼리 섞여있군요!


var workPieceInformationData = [WorkPieceInformation]()

let cellName = "workPieceItemCell"
Copy link
Contributor

Choose a reason for hiding this comment

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

cell identifier를 상수로 저장한 부분 너무 좋습니다 👍
다만 특정 메서드에서만 사용하는 상수라면 해당 메서드 내부에서 선언해주세요!

workPieceItemTableView.dataSource = self
}

func workPieceInformationJsonParsingData() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Main VC에서 언급했던 내용처럼 파싱 모델을 만들어서 구현해보면 좋을 거같아요!

workPieceInformationData = data
}

override func viewWillAppear(_ animated: Bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

viewDidLoad 메서드와 다른 위치에 있군요!
생명주기 메서드는 순서별로 같은 위치상에 있으면 읽기 좋답니다 ㅎㅎ

}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "workPieceItemDetail" {
Copy link
Contributor

Choose a reason for hiding this comment

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

segue의 identifier를 통해 데이터를 전달했군요!
이 방법도 있지만 TableView의 선택된 Indexpath의 Row의 내용을 그대로 전달하는 방법은 어떨까요??
WorkPieceItemViewController와 협동해서 구현해보면 좋을 거같아요!

지금 방식도 틀리지는 않습니다 !! 😀


class WorkPieceItemTableViewCell: UITableViewCell {

@IBOutlet weak var workPieceItemImageView: UIImageView!
Copy link
Contributor

Choose a reason for hiding this comment

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

은닉화 진행해주세요!

@IBOutlet weak var workPieceItemTitleLabel: UILabel!
@IBOutlet weak var workPieceItemDescriptionLabel: UILabel!

override func awakeFromNib() {
Copy link
Contributor

Choose a reason for hiding this comment

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

awakeFromNib 메서드는 어떤 메서드인가요??
현재 오버라이딩이 필요할까요??

Choose a reason for hiding this comment

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

awakeFromNib 메서드는 객체가 초기화 된 이후 호출되는 메서드입니다!
TableViewCell을 사용할 때 만들어진 것 같습니다.

super.awakeFromNib()
}

override func setSelected(_ selected: Bool, animated: Bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

setSelected 메서드는 어떤 메서드인가요??
현재 오버라이딩이 필요할까요??

import UIKit

class WorkPieceItemViewController: UIViewController {

Copy link
Contributor

Choose a reason for hiding this comment

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

불필요한 개행입니다!!

해당 객체의 프로퍼티와 메서드를 은닉화해보세요 💪

@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var navigationBar: UINavigationItem!

var prepareImage: String?
Copy link
Contributor

Choose a reason for hiding this comment

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

WorkPieceInformation 타입을 활용한다면 해당 프로퍼티들은 사용하지 않아도 될거같아요!

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