๐ŸŒฑ SeSAC

[SeSAC] 220718 TIL

taeeekki 2022. 7. 21. 23:02

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

 


 

6.  ์ž์ฃผ ์ƒ๊ธฐ๋Š” ์ด์Šˆ 3๊ฐ€์ง€๋Š” ํ™•์ธํ•˜์ž.

  1. Cell Identifier๋ฅผ ์ •ํ™•ํžˆ ๊ธฐ์ž…ํ•˜์ง€ ์•Š์•˜์„ ๋•Œ (- ํœด๋จผ์—๋Ÿฌ)
  2. ์…€์˜ ๊ฐœ์ˆ˜๋ฅผ ์ •ํ™•ํžˆ ๋ฆฌํ„ดํ•˜์ง€ ์•Š์„ ๋•Œ
  3. Row๊ฐ€ ์•„๋‹Œ Section์—๋งŒ ๊ฐœ์ˆ˜๋ฅผ ์ •ํ•ด๋†จ์„ ๋•Œ