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

[220718] TIL #54

Closed
Taehyeon-Kim opened this issue Jul 18, 2022 · 0 comments
Closed

[220718] TIL #54

Taehyeon-Kim opened this issue Jul 18, 2022 · 0 comments
Assignees

Comments

@Taehyeon-Kim
Copy link
Owner

Taehyeon-Kim commented Jul 18, 2022

1. 아웃렛 컬렉션(Outlet Collection)을 언제 사용하는 것이 좋을까에 대한 고민

단순 요소 반복 또는 동일한 UI 구성, 디자인적 요소를 다룰 때 적합하다고 볼 수 있다. 물론 인덱스를 활용해서 데이터에 접근하거나 변경하는 것도 가능하지만 이후에 UI 구조가 변경되거나 코드를 다시 확인하고자 할 때 어려움이 생길 수 있다. 디자인적인 부분과 데이터적인 부분은 분리가 더 적절할 수 있다.

2. 객체의 선언 위치 (feat. DateFormatter)

  1. 함수 내부
  2. 클래스 내부
  3. 파일 전체

3. TableView

Contents

  • Static cell : 형식이 항상 동일함
  • Dynamic type : 데이터에 따라 컨텐츠가 달라짐, 대부분의 경우 해당 방식을 사용

View

  • Header View
  • Footer View

Style

  • Plain
  • Grouped
  • Inset Grouped (iOS 13 ~)

필수 메서드

  • numberOfRowsInSection
  • cellForRowAt

4. TableView Cell

System

  • Basic (titleLabel, imageView)
  • Subtitle (textLabel, detailTextLabel, imageView)
  • Right detail (textLabel, detailTextLabel, imageView)
  • Left detail (textLabel, detailTextLabel)

5. IndexPaths

  • 특정 섹션의 특정 행에 대한 위치 정보
  • 섹션과 행의 속성을 통해 액세스 가능

(Section#, Row#)

  • indexPath.row
  • indexPath.section

3가지는 확인하자.

  1. Cell Identifier를 정확히 기입하지 않았을 때 (- 휴먼에러)
  2. 셀의 개수를 정확히 리턴하지 않을 때
  3. Row가 아닌 Section에만 개수를 정해놨을 때
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant