Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

[Refactor] ViewController을 위한 기본 Protocol 생성 #34

@ChoiysApple

Description

@ChoiysApple

기능 설명

UIViewController의 기본 설정 코드를 Protocol을 이용해 정리 & 코딩 컨벤션을 준수하도록 한다

현재 동작

UIViewController 코드에서 초기 설정 코드들을 현재는 configureUI()constraint 설정 코드를 넣고 viewDidLoad()에 초기 설정코드(.backgroundColor, tableView.delegate = self 등)을 같이 넣는 방식

기대 동작

setUpView(), configureUI() 함수를 가지는 프로토콜을 모든 UIViewController에서 채택하게 한다

protocol WViewController {
    func setUpView()
    func configureUI()
    func bindViewModel()
}
  1. setUpView() - tableView.delegate = self 같은 뷰컨트롤러 자체에 관한 설정
  2. configureUI() - addSubView()makeConstraints()3.
  3. bindViewModel() - 데이터 바인딩

setUpView 함수명은 예시입니다

configureUI 함수명은 현재도 사용중이므로 그대로 사용합니다

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions