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

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

Open
ChoiysApple opened this issue Jun 6, 2022 · 0 comments
Open

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

ChoiysApple opened this issue Jun 6, 2022 · 0 comments
Labels

Comments

@ChoiysApple
Copy link
Member

ChoiysApple commented Jun 6, 2022

기능 설명

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 함수명은 현재도 사용중이므로 그대로 사용합니다

@ChoiysApple ChoiysApple added ♻️ 리팩토링 기존 코드 리팩토링 ✨ 기능 labels Jun 6, 2022
@ChoiysApple ChoiysApple changed the title ViewController에 적용할 Protocol ViewController을 위한 기본 Protocol 생성 Jun 6, 2022
@ChoiysApple ChoiysApple changed the title ViewController을 위한 기본 Protocol 생성 [Refactor] ViewController을 위한 기본 Protocol 생성 Jul 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant